I have two Skype accounts; one for work, and one for personal use. Unfortunately, the Skype client for Linux is somewhat limited. It can store two usernames, but it saves only the last password entered. Tonight, I hacked up a solution.
I ran the Skype binary from the command line, and saw this:
tyler@baal:~$ skype --help Skype 126.96.36.199 Usage: skype [options] Options: --dbpath=
Specify an alternative path to store Skype data files. Default: ~/.Skype --resources= Specify a path where Skype can find its resource files. Default: /usr/share/skype --disable-api Disable Skype Public API. --pipelogin Command line login. "echo username password | skype --pipelogin" ...
This immediately suggested two possibilities.
- Create a script that reads usernames and passwords from a file, then calls
echo username password | skype --pipelogin. Obviously the file is a security risk, but don’t fool yourself. The obfuscated password in the Skype configuration file is no safer.
- Create a ~/.Skype-name directory for each account, and call
skype --dbpath ~/.Skype-name. This has the advantage of letting Skype store the password, but means any configuration changes to Skype have to be made twice.
cat > ~/.Skype/passwords
workuser1 password1 homeuser2 password2
chmod 600 ~/.Skype/passwords
Then I wrote a simple script to do the following:
- Read the password file
- Display a zenity dialog with a list of usernames
- Find the password of the selected user
- Call Skype
Here it is: skype-fe. It worked on the first try. It’s a total hack, and I love it. It is based on previous zenity scripts I’ve written, so it’s not quite as simple as I let on. It won’t shred your hard drive, I promise.