summaryrefslogtreecommitdiffstats
path: root/core/modules/idleaction
diff options
context:
space:
mode:
authorSimon Rettberg2018-10-18 12:28:07 +0200
committerSimon Rettberg2018-10-18 12:28:07 +0200
commitf98d008659278eee58c9693aefb6f611af980c71 (patch)
tree7c0365c3dda1410c67e07ef4248a70cb5a9f0ff2 /core/modules/idleaction
parent[rfs-stage32] Copy gconv .so files, as they're dlopen()'d (diff)
downloadmltk-f98d008659278eee58c9693aefb6f611af980c71.tar.gz
mltk-f98d008659278eee58c9693aefb6f611af980c71.tar.xz
mltk-f98d008659278eee58c9693aefb6f611af980c71.zip
[idleaction] Force screen on; sanity check for shutdownDeadline
Diffstat (limited to 'core/modules/idleaction')
-rwxr-xr-xcore/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script2
-rwxr-xr-xcore/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action4
2 files changed, 5 insertions, 1 deletions
diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script
index 4741837a..4867883e 100755
--- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script
+++ b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script
@@ -137,6 +137,8 @@ if [ -n "${SLX_LOGOUT_TIMEOUT}" ] && [ "${SLX_LOGOUT_TIMEOUT}" -gt 0 ]; then
date +%s > /run/openslx/session-killed
loginctl terminate-session "$ses"
else
+ # Give user a chance to see that it's going to logout in 5 mins
+ [ "$(( TIMEOUT - NOW ))" -lt 310 ] && xset dpms force on
IS_IDLE=no
fi
else
diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
index 7cfb557d..35b31748 100755
--- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
+++ b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action
@@ -79,7 +79,7 @@ for f in /run/openslx/idleaction-*; do
[ -f "$f" ] || continue
grep -q '^shutdownDeadline=' "$f" || continue
RET=$(awk -F= '{if ($1 == "shutdownDeadline") { print $2; exit } }' "$f")
- if [ -z "$RET" ] || [ "$RET" -eq 0 ] || ! [ "$RET" -lt "$timeout" ]; then
+ if [ -z "$RET" ] || [ "$RET" -eq 0 ] || ! [ "$RET" -lt "$timeout" ] || [ 333 -lt "$(( NOW - RET ))" ]; then
sed -i "s/^shutdownDeadline=.*$/shutdownDeadline=$timeout/" "$f"
fi
done
@@ -112,6 +112,8 @@ runaction () {
# X11
export DISPLAY=$d
export XAUTHORITY=$(ps a | grep " $DISPLAY " | grep -o -- '-auth.*$' | grep -m1 -v grep | awk '{print $2}')
+ # Make sure user sees warning
+ xset dpms force on
# TODO: Don't look... We need to pick a proper util for this
/opt/openslx/cups/printergui --error "$MESSAGE" &
unset DISPLAY XAUTHORITY