From ddb79d2950cb9dc0a41797807bf5133dd8f4da12 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 13 May 2019 16:13:31 +0200 Subject: [xscreensaver/idleaction] Use idle-daemon --- .../data/etc/X11/Xsession.d/95-xscreensaver | 26 ++++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'core/modules/xscreensaver') diff --git a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver b/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver index 2b4fbef5..1220dad3 100755 --- a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver +++ b/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver @@ -1,8 +1,8 @@ #!/bin/ash -DPMS=False -AUTOLOCK=True if which xscreensaver; then + DPMS=False + AUTOLOCK=True secsToTime() { local NUM SECS MINS HRS NUM="$1" @@ -14,9 +14,8 @@ if which xscreensaver; then [ -z "$UID" ] && UID=$(id -u) [ -z "$HOME" ] && HOME="$(getent passwd "$UID" | head -n 1 | awk -F ':' '{print $6}')" . /opt/openslx/config - SBY=${SLX_SCREEN_STANDBY_TIMEOUT} + SBY="${SLX_SCREEN_STANDBY_TIMEOUT}" if [ -n "${SLX_EXAM}" ]; then - SLX_LOGOUT_TIMEOUT=0 SLX_SCREEN_SAVER_TIMEOUT=0 SLX_SCREEN_SAVER_GRACE_TIME= AUTOLOCK=False @@ -28,23 +27,16 @@ if which xscreensaver; then elif ! [ "$SBY" -ge 0 ]; then # isNumeric? SBY=0 fi - # Make sure standby timeout is less than logout timeout, otherwise, disable standby + # Create config value for standby timeout if [ "$SBY" -gt 0 ]; then - if [ "$SLX_LOGOUT_TIMEOUT" -gt 0 ]; then - if [ "$SBY" -lt 300 ]; then - SBY=300 - fi - if [ "$SLX_LOGOUT_TIMEOUT" -lt "$SBY" ]; then - SBY=0 - fi - fi + DPMS=True + STANDBY="$( secsToTime "$(( SBY + 60 ))" )" + else + STANDBY="99:00:00" fi - # Create config value for standby timeout - [ "$SBY" -gt 0 ] && DPMS=True - STANDBY="$( secsToTime "$SBY" )" # Explicit screen saver timeout set if [ "$SLX_SCREEN_SAVER_TIMEOUT" -gt 0 ]; then - TIMEOUT="$( secsToTime "$SLX_SCREEN_SAVER_TIMEOUT" )" + TIMEOUT="$( secsToTime "$(( SLX_SCREEN_SAVER_TIMEOUT + 30 ))" )" else TIMEOUT="99:00:00" fi -- cgit v1.2.3-55-g7522