From 33c91da223cb00d1be88230117841d3f5b6c6772 Mon Sep 17 00:00:00 2001 From: Thomas Cole Date: Tue, 22 Apr 2025 10:09:31 -0400 Subject: [PATCH 1/8] Testing timeout setting as part of config.json --- config.json.sample | 5 ++++- scripts/switcher.sh | 3 ++- web/index.html | 19 +++++++++++++------ web/script.js | 5 +++++ 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/config.json.sample b/config.json.sample index f590e60..a139855 100644 --- a/config.json.sample +++ b/config.json.sample @@ -21,5 +21,8 @@ { "url": "https://www.google.com/search?q=nasdaq+index" } - ] + ], + "settings":{ + "page_timeout": 10 + } } diff --git a/scripts/switcher.sh b/scripts/switcher.sh index ba68e7b..14029eb 100755 --- a/scripts/switcher.sh +++ b/scripts/switcher.sh @@ -8,6 +8,7 @@ export XDG_RUNTIME_DIR=/run/user/1000 # count the number of URLs, that are configured to cycle through URLS=$(jq -r '.urls | length' /opt/piosk/config.json) +TIMEOUT=$(jq -r '.settings.page_timeout | /opt/piosk/config.json') # swich tabs each 10s, refresh tabs each 10th cycle & then reset for ((TURN=1; TURN<=$((10*URLS)); TURN++)) do @@ -20,5 +21,5 @@ for ((TURN=1; TURN<=$((10*URLS)); TURN++)) do fi fi fi - sleep 10 + sleep $TIMEOUT done diff --git a/web/index.html b/web/index.html index 89eb409..ab6822c 100644 --- a/web/index.html +++ b/web/index.html @@ -9,8 +9,8 @@ PiOSK -