summaryrefslogtreecommitdiffstats
path: root/remote/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver')
-rwxr-xr-xremote/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver33
1 files changed, 33 insertions, 0 deletions
diff --git a/remote/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver b/remote/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver
new file mode 100755
index 00000000..fc6588ae
--- /dev/null
+++ b/remote/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver
@@ -0,0 +1,33 @@
+#!/bin/ash
+
+if which xscreensaver; then
+ [ -z "$UID" ] && UID=$(id -u)
+ [ -z "$HOME" ] && HOME="$(getent passwd "$UID" | head -n 1 | awk -F ':' '{print $6}')"
+ if ! [ -s "$HOME/.xscreensaver" ]; then
+ . /opt/openslx/config
+ NUM=${SLX_SCREEN_STANDBY_TIMEOUT}
+ if [ -n "$NUM" ] && [ "$NUM" -gt 60 ]; then
+ SECS=0$(( NUM % 60 ))
+ MINS=0$(( ( NUM / 60 ) % 60 ))
+ HRS=0$(( ( NUM / 3600 ) % 60 ))
+ STANDBY="${HRS:$(( ${#HRS} - 2 )):2}:${MINS:$(( ${#MINS} - 2 )):2}:${SECS:$(( ${#SECS} - 2 )):2}"
+ else
+ STANDBY=0:00:00
+ fi
+ cat > "$HOME/.xscreensaver" <<EOF
+mode: blank
+timeout: 24:00:00
+lock: True
+lockTimeout: 0:00:10
+fade: False
+unfade: False
+dpmsEnabled: True
+dpmsStandby: $STANDBY
+dpmsSuspend: $STANDBY
+dpmsOff: $STANDBY
+EOF
+ fi
+ xscreensaver -no-splash &
+fi
+true
+