Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-19-2009, 06:35 PM   #1
Registered: Mar 2005
Posts: 122

Rep: Reputation: 15
Scripting a work around to turn off monitor with xscreensaver

I am trying to use the electricsheep screensaver but for some reason it seems to be the only one that wont let the monitor go into an off state (other hacks work). I have posted on the maintainer of electricsheeps web site but I would like to get some help to script a work-around. Xscreensaver provides for interaction with scripts with xscreensaver-command watch so a script can be run on start and stop of the screensaver. I would like to have xscreensaver start a script that lets the screensaver run (BLANKS) for awhile then does an xset dpms force off. If somebody interrupts the screensaver (the screen UNBLANKS) I would like the script that was started to stop so the screen doesnt get forced off. So far all my attempts have been feeble I think because of the way the process the script calls are spawned but I am not sure. Here is the code for the xscreensaver monitor script. You put the 2 scripts in the same directory that you want run with the BLANKING and UNBLANKING of the screen.


my $blanked = 0; open (IN, "xscreensaver-command -watch |"); while (<IN>) { if (m/^(BLANK|LOCK)/) { if (!$blanked) { system "startcountdown"; $blanked = 1; } } elsif (m/^UNBLANK/) { system "killer"; $blanked = 0; } }
In this instance my 2 scripts are called startcountdown and killer


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
xscreensaver broken after install LCD monitor whitster Debian 9 12-26-2007 01:56 PM
X+Twinview: Can xscreensaver independently blank/unblank only one monitor at a time?? GrapefruiTgirl Linux - Desktop 4 09-21-2007 05:46 AM
Monitor turn off mrxtheking Slackware 8 03-29-2006 06:26 PM
Turn off monitor? Zeno McDohl Slackware 14 01-26-2006 07:20 PM
XScreensaver will not turn monitor off Panzerfrost Linux - Software 8 12-16-2003 04:05 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:14 AM.

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