Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I leave work, I lock my machine with ctrl + l to lock the screen. When I come back, I always forget to log into jabber. Is there a way to run a command after the screen is unlocked? This is in KDE. I'm not sure if the locking mechanism is an X feature or a KDE feature, so I'm not sure where to look.

share|improve this question

1 Answer

I had a desire to make banshee (the Gnome music player) pause/unpause when the screen was locked/unlocked. I found a ticket in the banshee launchpad project:

https://bugs.launchpad.net/banshee/+bug/237687

Someone had created a script which would notice (via DBus) if the screen was (un)locked and would trigger banshee to (un)pause. I added a small tweak to this script and have been using it for a while. I added my updated copy to that ticket.

Now I know this isn't exactly what you want to do. But you could probably take that python script (which is already detecting screen locks/unlocks) and alter it slightly to do what you would like to do. It is also my understanding that the KDE screensaver supports the same DBus interface as the gnome screensaver. It seems like the best documentation for the KDE side of things is here:

http://quickgit.kde.org/?p=kde-workspace.git&a=blob&f=krunner/screensaver/saverengine.h

Good luck!

share|improve this answer
So is the lock screen considered a screen saver? – Falmarri Jul 11 '11 at 17:15
Yeah. I mean, I'm pretty sure they both produce the same event in DBus. – Mark Drago Jul 11 '11 at 21:58
For KDE users, substitute "org.freedesktop.ScreenSaver" for the Gnome specific string on the second last line of the script. – casualunixer Feb 9 at 16:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.