diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-06-26 21:44:11 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-06-26 21:44:11 +0200 |
commit | 5af00252696768876d95cee60a2c373fda80a26d (patch) | |
tree | 5b11709903066b9ac76fdb203e66a6c738c66b1f | |
parent | bb1091f9ff510fa0e2a554be2a71df4c9aa22a69 (diff) | |
download | colin-keep-5af00252696768876d95cee60a2c373fda80a26d.tar colin-keep-5af00252696768876d95cee60a2c373fda80a26d.tar.gz colin-keep-5af00252696768876d95cee60a2c373fda80a26d.tar.bz2 colin-keep-5af00252696768876d95cee60a2c373fda80a26d.tar.xz colin-keep-5af00252696768876d95cee60a2c373fda80a26d.zip |
Added disable/enable screen saver
-rw-r--r-- | lib/AdminPanel/Shared.pm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/AdminPanel/Shared.pm b/lib/AdminPanel/Shared.pm index a1df114..ce8e4e3 100644 --- a/lib/AdminPanel/Shared.pm +++ b/lib/AdminPanel/Shared.pm @@ -232,5 +232,44 @@ sub pathList2hash { return \%tree; } +#============================================================= + +=head2 disable_x_screensaver + +=head3 DESCRIPTION + +if exists /usr/bin/xset disable screensaver + +=cut + +#============================================================= +sub disable_x_screensaver() { + if (-e '/usr/bin/xset') { + $ENV{PATH} = "/usr/bin:/usr/sbin"; + system ("/usr/bin/xset s off"); + system ("/usr/bin/xset -dpms"); + } +} + +#============================================================= + +=head2 enable_x_screensaver + +=head3 DESCRIPTION + +if exists /usr/bin/xset enables screensaver + +=cut + +#============================================================= +sub enable_x_screensaver() { + if (-e '/usr/bin/xset') { + $ENV{PATH} = "/usr/bin:/usr/sbin"; + system ("/usr/bin/xset +dpms"); + system ("/usr/bin/xset s on"); + system ("/usr/bin/xset s reset"); + } +} + 1; # End of AdminPanel::Shared |