How to Start Pidgin Minimized (or always start Pidgin with its buddy list invisible)

Pidgin does not have an option that allows a user decide whether the Pidgin buddy list window starts minimized or not. It just remembers the state of the window when it quits, and restores the last window state.

The last window status is stored in $HOME/.purple/prefs.xml:

...
<pref name='pidgin'>
  ...
  <pref name='blist'>
  ...
    <pref name='list_visible' type='bool' value='0'/> <!-- 0: invisible, 1: visible -->
    <pref name='list_maximized' type='bool' value='0'/> <!-- 0: normal, 1: maximized -->
  ,,,
  </pref>
</pref>
...

When the list_visible property is set to 0, you will see Pidgin minimizes its buddy list window into the system tray (or the notification area). How can we make sure it’s always set to 0 when Pidgin updates it when it exits? Let’s write a shell script:

#!/bin/bash
perl -pi -e "s/pref name='(list_visible|list_maximized)' type='bool' value='[1-9]'/pref name='$1' type='bool' value='0'/gi" ~/.purple/prefs.xml
/usr/bin/pidgin &

The first perl command searches the list_visible and list_maximized properties and replaces their values with 0 before Pidgin starts. Problem solved!

Not that I like this workaround. I still just can’t believe there is no option about this.