LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Trigger bash script when screen saver starts of desktop gets locked (http://www.linuxquestions.org/questions/programming-9/trigger-bash-script-when-screen-saver-starts-of-desktop-gets-locked-659270/)

BinWondrin 07-30-2008 10:30 AM

Trigger bash script when screen saver starts of desktop gets locked
 
This is probably relatively easy if you know where to look. :scratch:
I run a KDE desktop on a Fedora 8 system.
I would like to trigger a bash script whenever the screen saver comes on when I lock the workstation.

Any ideas are appreciated.

matthewg42 07-31-2008 03:56 AM

Maybe the kscreensaver sends a dbus or dcop event which you can monitor for?

I know you can set the screen saver using dcop, like this (using the command line dcop tool):

Code:

dcop kdesktop KScreensaverIface lock
I'm not sure about the opposite case, I suppose you'd need to find out if (and what) a dcop signal is sent when the screensaver activates. See the "DCOP Signals" section of this page for more info.

matthewg42 07-31-2008 04:24 AM

Hang on a minute, I think I'm making things too complicated - could you explain in more detail what you want to achieve?

BinWondrin 07-31-2008 06:45 PM

trigger script on lock
 
I want to trigger a security camera script whenever the desktop is locked. I assume that I will work at the desk when the screen is not locked.
;-)

I actually ran
Code:

ps -ef| grep userid > before
and
Code:

ps -ef| grep userid > after
from the console and noticed that there is a process called:
kdesktop_lock which will only run when it is locked.
I like your idea better though. I will look into it.

Thanks!

matthewg42 08-01-2008 03:40 AM

Aha I see - nice idea btw - about a video camera.

If you can't track down a dcop signal, then the next thing I would suggest is to write a simple screen saver yourself. You could add whatever code is necessary to trigger the camera into the screen saver directly.


All times are GMT -5. The time now is 03:42 AM.