LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-19-2009, 05:35 PM   #1
dasbooter
Member
 
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.

Code:
#!/usr/bin/perl

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
 
  


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
xscreensaver broken after install LCD monitor whitster Debian 9 12-26-2007 12:56 PM
X+Twinview: Can xscreensaver independently blank/unblank only one monitor at a time?? GrapefruiTgirl Linux - Desktop 4 09-21-2007 04:46 AM
Monitor turn off mrxtheking Slackware 8 03-29-2006 05:26 PM
Turn off monitor? Zeno McDohl Slackware 14 01-26-2006 06:20 PM
XScreensaver will not turn monitor off Panzerfrost Linux - Software 8 12-16-2003 03:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:24 AM.

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