From 001ccc69cbff3761bd099b44ca2cdffed1bca335 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Mar 2024 17:30:19 +0100 Subject: [kiosk-chromium] Poke idle-daemon some more to get accurate idle times --- .../data/opt/openslx/scripts/kiosk-launch.d/00-chromium | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core') 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 0c949044..8ae8a917 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 @@ -89,6 +89,8 @@ fi if [ -n "$SLX_BROWSER_RELOAD_SECS" ] && [ "$SLX_BROWSER_RELOAD_SECS" -gt 0 ]; then ( + # Wake up to force refresh + idle-daemon --send 'get :0' &> /dev/null wid= while [ -z "$wid" ]; do sleep 1 @@ -105,7 +107,8 @@ if [ -n "$SLX_BROWSER_RELOAD_SECS" ] && [ "$SLX_BROWSER_RELOAD_SECS" -gt 0 ]; th fi readonly wpid activity=init - last= + last="$(idle-daemon --send 'get :0' | grep -oP '(?<=idleSeconds=)[0-9]+')" + sleep 1 while true; do if [ ! -d "/proc/$wpid" ]; then echo "Process with PID $wpid stopped, exiting auto-reload loop." @@ -122,6 +125,9 @@ if [ -n "$SLX_BROWSER_RELOAD_SECS" ] && [ "$SLX_BROWSER_RELOAD_SECS" -gt 0 ]; th xdotool key Alt+Home last="$current_idle" sleep "$SLX_BROWSER_RELOAD_SECS" + # Wake up to force refresh + idle-daemon --send 'get :0' &> /dev/null + sleep 1 activity=init continue fi -- cgit v1.2.3-55-g7522