Is it possible to create a "Lock Session" script?

As the title suggests, I am looking for a way to execute a command every time I lock session and unlock it.

For example, my work computer is on 24/7. When I go home I just hit the (GUI) lock button and leave. The only problem is that my Skype account is still logged in, meaning people call me thinking I am online when I am not.

Anyway, I figure there must be a way to edit the code that locks the session to say ‘sign out of skype first, then lock’. And vice versa for unlocking.

Being a relative newbie (at least to programming), I have no idea how to do this. I would like to know if it is possible, and if anyone can instruct me how to do it, or at least how to go about this.

Have a look at the man page for xscreensaver-command and the -watch
section, that should get you started :slight_smile:

Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel
up 4 days 0:54, 3 users, load average: 0.32, 0.17, 0.11
GPU GeForce 8600 GTS Silent - Driver Version: 180.51