LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-29-2014, 05:56 PM   #1
Shruikan
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Rep: Reputation: Disabled
Running script after screen wake - Debian 7


Hi All,

We have a few labs of Debian machines and after 10 minutes the screens turn off (we want this). The machine never goes into a sleep state, nor does it hibernate - the screens just turn off.

What I would like to know is where can I append a line of code which will run a command when the screens come back on from mouse movement or keyboard input.

I am aware of /etc/pm/ however it does not seem to cater simply for "screen wake".

Any ideas?
Thank you very much!
 
Old 07-30-2014, 03:02 PM   #2
Spatior
Member
 
Registered: Jun 2009
Location: México
Distribution: Suse, Debian based, CentOs
Posts: 48

Rep: Reputation: 10
Hi Shruikan,

I have never have this need, but I got intiged with your question, so I'll toss an idea:

After a quick search on the web I found this dbus-monitor command that seems to "catch" the session states

Code:
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'"
I have not hte possibility to test it right but seems that this returns a boolean value so it should be possible to catch that value and operate based on it

So my idea is that you put that in a script that runs on the background and see what is returned when you lock/unlock the screen then use the different states trigger whatever you need to do.

Let us know if you get this working, is interesting

HTH
 
1 members found this post helpful.
Old 07-30-2014, 05:12 PM   #3
Shruikan
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi Spatior,

Thank you very much for this! This is definitely a great lead to go on. I'm pretty new to the Linux world when it comes to doing things such as this but it does sound like some fun to play with. I'll see if I get some time today and let you know what I find.

If you do happen to get to play with it yourself, let me know! haha.

Cheers,
Shruikan.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Input to a screen session from a script running outside Skaperen Linux - Software 0 08-01-2012 05:15 PM
[SOLVED] Problem Running Bash Script in new Screen.. timdvtemp Programming 4 02-17-2011 07:41 AM
Black Screen after running 'xstart' on Debian install TJSexton Linux - Newbie 9 06-10-2009 12:51 AM
Screen does not wake up after going to sleep at promp PSIPHON Linux - General 1 08-09-2005 08:30 PM
debian locking at screen but still running Silent1 Debian 2 12-29-2004 11:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:29 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration