Created
October 17, 2014 15:55
-
-
Save alja/e35aaa241e5d824fced8 to your computer and use it in GitHub Desktop.
disable screen going to sleep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = | |
localtime(time); | |
$stt = localtime; | |
print "ssCheck $stt HOUR = $hour \n"; | |
$ENV{DISPLAY}=':0.0'; | |
$ENV{PATH}="/usr/local/bin:/bin:/usr/bin:/usr/sbin"; | |
$ENV{LD_LIBRARY_PATH}="/usr/sbin:/usr/local/lib"; | |
for $k (sort keys %ENV) { print $k, "\n"; } | |
if ($hour >= 19) | |
{ | |
system("xset dpms force off"); | |
printf("disable \n"); | |
} | |
elsif ($hour >= 7) | |
{ | |
system("xset -dpms"); | |
system("xdotool mousemove_relative 0 1"); | |
sleep 1; | |
system("xdotool mousemove_relative 0 -1"); | |
printf("wake up \n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment