LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-30-2008, 10:30 AM   #1
BinWondrin
Member
 
Registered: Jun 2008
Distribution: Fedora, RHEL, Ubuntu
Posts: 33

Rep: Reputation: 15
Trigger bash script when screen saver starts of desktop gets locked


This is probably relatively easy if you know where to look.
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.
 
Old 07-31-2008, 03:56 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
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.
 
Old 07-31-2008, 04:24 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
Hang on a minute, I think I'm making things too complicated - could you explain in more detail what you want to achieve?
 
Old 07-31-2008, 06:45 PM   #4
BinWondrin
Member
 
Registered: Jun 2008
Distribution: Fedora, RHEL, Ubuntu
Posts: 33

Original Poster
Rep: Reputation: 15
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!
 
Old 08-01-2008, 03:40 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE Desktop Sharing (krfb) and screen saver theKapn Linux - Desktop 0 10-05-2006 07:37 PM
Start the screen saver from a script aabfm Linux - General 3 08-05-2006 03:55 PM
How to turn off screen blanking screen saver in run level 3? Arodef Linux - Software 1 01-04-2005 12:50 PM


All times are GMT -5. The time now is 04:47 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration