summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2020-02-05 16:58:02 +0100
committerJonathan Bauer2020-02-05 16:58:02 +0100
commit0155b861cbccdd62093c15626490a11a98067ead (patch)
tree2164559051a0c7a8a352923b95aa3530bd5063d1
parent[kiosk-common] export PATH... (diff)
downloadmltk-0155b861cbccdd62093c15626490a11a98067ead.tar.gz
mltk-0155b861cbccdd62093c15626490a11a98067ead.tar.xz
mltk-0155b861cbccdd62093c15626490a11a98067ead.zip
[kiosk-chromium] do not reload while user acts
-rw-r--r--core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium25
1 files changed, 19 insertions, 6 deletions
diff --git a/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium b/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium
index 9ee4ca19..bdbd275e 100644
--- a/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium
+++ b/core/modules/kiosk-chromium/data/opt/openslx/scripts/kiosk-launch.d/00-chromium
@@ -95,13 +95,26 @@ if [ -z "$SLX_BROWSER_INTERACTIVE" ]; then
# xbinkeys requires a daemon, run it
xbindkeys_autostart &
- if [ -n "$SLX_BROWSER_RELOAD_SECS" ]; then
- while true; do
- xdotool windowactivate "$(xdotool search --onlyvisible --class browser)"
+fi
+
+if [ -n "$SLX_BROWSER_RELOAD_SECS" ]; then
+ (
+ while true; do
+ wid="$(xdotool search --onlyvisible --class browser)"
+ [ -z "$wid" ] && sleep 1 && continue
+ readonly wid
+ wpid="$(xprop -id "$wid" | awk -F= '$1 ~ /_NET_WM_PID\(CARDINAL\)/ {print $2}' | tr -d ' ')"
+ readonly wpid
+ [ ! -d "/proc/$wpid" ] && exit 0
+ current_idle="$(idle-daemon --send 'get :0' | grep -oP '(?<=idleSeconds=)[0-9]+')"
+ if [ "$current_idle " -ge "$SLX_BROWSER_RELOAD_SECS" ]; then
+ xdotool windowactivate "$wid"
xdotool key Alt+Home
- sleep "$SLX_BROWSER_RELOAD_SECS"
- done &
- fi
+ continue
+ fi
+ sleep "$(( SLX_BROWSER_RELOAD_SECS - current_idle ))"
+ done
+ ) &
fi
if [ -n "$SLX_BROWSER_INSECURE" ]; then