diff options
author | Christian Rößler | 2016-11-04 15:59:25 +0100 |
---|---|---|
committer | Christian Rößler | 2016-11-04 15:59:25 +0100 |
commit | 13a665d7317615b472a66ce08fe6c0d126cdea39 (patch) | |
tree | d5fd4b5f9879f97b5032fc99951d6d3aafc7e7df /remote/modules/screen-standby/data/opt/openslx/scripts/screen-standby | |
parent | [run-virt] resolution scripts now detect first connected output device (not o... (diff) | |
parent | [rfs-stage32] Run update-issue after setup_partitions for proper /tmp display (diff) | |
download | tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.tar.gz tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.tar.xz tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.zip |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/screen-standby/data/opt/openslx/scripts/screen-standby')
-rwxr-xr-x | remote/modules/screen-standby/data/opt/openslx/scripts/screen-standby | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/remote/modules/screen-standby/data/opt/openslx/scripts/screen-standby b/remote/modules/screen-standby/data/opt/openslx/scripts/screen-standby new file mode 100755 index 00000000..74a09556 --- /dev/null +++ b/remote/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 + |