summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSimon Rettberg2019-05-14 15:48:44 +0200
committerSimon Rettberg2019-05-14 15:48:44 +0200
commitd8acc57f354a93929573393850c61e01c2f8d103 (patch)
treebe40e0be4037a5993cf95a46ab4145b44b138b10 /core
parent[idleaction] Refine exam mode shutdown/reboot timing (diff)
downloadmltk-d8acc57f354a93929573393850c61e01c2f8d103.tar.gz
mltk-d8acc57f354a93929573393850c61e01c2f8d103.tar.xz
mltk-d8acc57f354a93929573393850c61e01c2f8d103.zip
[xscreensaver/idleaction] DPMS handled by idle-daemon
Diffstat (limited to 'core')
-rw-r--r--core/modules/idleaction/data/etc/X11/Xsession.d/50-set_session_dpms18
-rwxr-xr-xcore/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver (renamed from core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver)30
-rw-r--r--core/modules/idleaction/data/etc/X11/Xsetup.d/50-set_lightdm_dpms (renamed from core/modules/idleaction/data/etc/X11/Xsession.d/50-set_lightdm_dpms)0
-rw-r--r--core/modules/xscreensaver/module.build4
4 files changed, 22 insertions, 30 deletions
diff --git a/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_session_dpms b/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_session_dpms
new file mode 100644
index 00000000..3459a503
--- /dev/null
+++ b/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_session_dpms
@@ -0,0 +1,18 @@
+#!/bin/ash sourced
+
+# Set DPMS values in Xsession. This will apply for user sessions
+
+if [ -z "$SLX_PXE_SERVER_IP" ] && [ -z "$SLX_SCREEN_STANDBY_TIMEOUT" ]; then
+ . /opt/openslx/config # Not sourced yet
+fi
+
+xset s off
+if [ -n "$SLX_SCREEN_STANDBY_TIMEOUT" ]; then
+ xset dpms 0 0 0 &> /dev/null
+ xset +dpms &> /dev/null
+else
+ xset -dpms &> /dev/null
+fi
+
+:
+
diff --git a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver
index 1220dad3..6e4d93f8 100755
--- a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver
+++ b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver
@@ -1,7 +1,6 @@
#!/bin/ash
if which xscreensaver; then
- DPMS=False
AUTOLOCK=True
secsToTime() {
local NUM SECS MINS HRS
@@ -14,31 +13,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}"
if [ -n "${SLX_EXAM}" ]; then
- SLX_SCREEN_SAVER_TIMEOUT=0
SLX_SCREEN_SAVER_GRACE_TIME=
- AUTOLOCK=False
- SBY=0
- elif [ -z "$SBY" ]; then
- SBY=0
- elif [ "$SBY" -gt 0 ] && [ "$SBY" -lt 60 ]; then
- SBY=60
- elif ! [ "$SBY" -ge 0 ]; then # isNumeric?
- SBY=0
- fi
- # Create config value for standby timeout
- if [ "$SBY" -gt 0 ]; then
- DPMS=True
- STANDBY="$( secsToTime "$(( SBY + 60 ))" )"
- else
- STANDBY="99:00:00"
- fi
- # Explicit screen saver timeout set
- if [ "$SLX_SCREEN_SAVER_TIMEOUT" -gt 0 ]; then
- TIMEOUT="$( secsToTime "$(( SLX_SCREEN_SAVER_TIMEOUT + 30 ))" )"
- else
- TIMEOUT="99:00:00"
fi
if [ -z "$SLX_SCREEN_SAVER_GRACE_TIME" ]; then
GRACE="99:00:00"
@@ -50,15 +26,11 @@ if which xscreensaver; then
cat > "$HOME/.xscreensaver" <<EOF
mode: one
cycle: 99:00:00
-timeout: $TIMEOUT
+timeout: 99:00:00
lock: $AUTOLOCK
lockTimeout: $GRACE
fade: False
unfade: False
-dpmsEnabled: $DPMS
-dpmsStandby: $STANDBY
-dpmsSuspend: $STANDBY
-dpmsOff: $STANDBY
dpmsFullThrottle: True
newLoginCommand:
externalUngrabCommand: /opt/openslx/xscreensaver/ungrab
diff --git a/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_lightdm_dpms b/core/modules/idleaction/data/etc/X11/Xsetup.d/50-set_lightdm_dpms
index c036e22a..c036e22a 100644
--- a/core/modules/idleaction/data/etc/X11/Xsession.d/50-set_lightdm_dpms
+++ b/core/modules/idleaction/data/etc/X11/Xsetup.d/50-set_lightdm_dpms
diff --git a/core/modules/xscreensaver/module.build b/core/modules/xscreensaver/module.build
index 676def43..e7e60e26 100644
--- a/core/modules/xscreensaver/module.build
+++ b/core/modules/xscreensaver/module.build
@@ -10,8 +10,10 @@ build() {
mkdir -p "${MODULE_BUILD_DIR}/usr/bin"
cde "$SRCDIR/xscreensaver"
pinfo "Building xscreensaver"
+ # Disable DPMS handling since we're using idle-daemon
+ # which accounts for our beautiful vmware ungrab crap
./configure --enable-locking --disable-root-passwd \
- --with-dpms-ext --with-xinput-ext --with-xf86vmode-ext \
+ --without-dpms-ext --with-xinput-ext --with-xf86vmode-ext \
--with-randr-ext --with-pam --with-login-manager \
--prefix=/usr --without-proc-interrupts $REQUIRED_CONFIGURE_OPTIONS \
|| perror "'./configure' failed"