summaryrefslogtreecommitdiffstats
path: root/core/modules/screen-standby/data/opt/openslx/scripts/screen-standby
diff options
context:
space:
mode:
authorJonathan Bauer2016-12-23 13:12:09 +0100
committerJonathan Bauer2016-12-23 13:12:09 +0100
commit6806ae4a850fc7785a8c05304237cf53b5b8f951 (patch)
treeb1dd8413d6c7b9a250251da7f0d49bb52b4ddc57 /core/modules/screen-standby/data/opt/openslx/scripts/screen-standby
parentwrong kernel version variable used (diff)
downloadmltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.gz
mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.xz
mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.zip
merge with latest dev version (tm-scripts commit f5a59daf8d70a9027118292cd40b18c221897408)
Diffstat (limited to 'core/modules/screen-standby/data/opt/openslx/scripts/screen-standby')
-rwxr-xr-xcore/modules/screen-standby/data/opt/openslx/scripts/screen-standby29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/modules/screen-standby/data/opt/openslx/scripts/screen-standby b/core/modules/screen-standby/data/opt/openslx/scripts/screen-standby
new file mode 100755
index 00000000..74a09556
--- /dev/null
+++ b/core/modules/screen-standby/data/opt/openslx/scripts/screen-standby
@@ -0,0 +1,29 @@
+#!/bin/ash
+
+# This is usually sourced by Xstartup/session/reset
+
+do_standby_stuff () {
+ . /opt/openslx/config
+ # Make sure SLX_SCREEN_STANDBY_TIMEOUT is numeric
+ TO=${SLX_SCREEN_STANDBY_TIMEOUT}
+ [ -z "${TO}" ] && TO=0
+ [ "${TO}" -gt 0 ] || [ "${TO}" -lt 100 ] || TO=600
+ [ "${TO}" -lt 0 ] && TO=0
+ MIN=$(( TO / 60 ))
+ [ "$MIN" -gt 60 ] && MIN=60
+ # Set
+ setterm -blank "$MIN"
+ setterm -powerdown "$MIN"
+ if [ "${TO}" = 0 ]; then
+ # Off
+ xset s "${TO}" "${TO}"
+ xset s off -dpms
+ else
+ xset +dpms
+ xset s "${TO}" "${TO}"
+ fi
+}
+
+do_standby_stuff &
+true
+