From 95703efa61dd202f6d14b58ba4e60507f66f72eb Mon Sep 17 00:00:00 2001 From: Rod Wright Date: Fri, 27 Feb 2026 10:53:47 -0500 Subject: [PATCH] Added conf_file arguments to view scripts --- usr/local/bin/kiosk_startkiosk | 8 ++++---- usr/local/bin/kiosk_viewhtml | 9 ++++++--- usr/local/bin/kiosk_viewpdf | 11 +++++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/usr/local/bin/kiosk_startkiosk b/usr/local/bin/kiosk_startkiosk index 819685d..b960b35 100755 --- a/usr/local/bin/kiosk_startkiosk +++ b/usr/local/bin/kiosk_startkiosk @@ -36,18 +36,18 @@ function set_commands() { elif echo "$TGT_URL" | grep -q '\.pdf$' then # The URL is a pdf file - APP_CMD="kiosk_viewpdf $TGT_URL" + APP_CMD="kiosk_viewpdf $TGT_URL $conf_file" ALIVE_STRING="xpdf" KILL_CMD="pkill xpdf" CLEANUP_CMD="kiosk_cleanup" - debuglog "URL is a pdf file. Command is $PDF_APP_CMD" + debuglog "URL is a pdf file. Command is $APP_CMD" else # Assume the URL returns HTML - APP_CMD="kiosk_viewhtml $TGT_URL" + APP_CMD="kiosk_viewhtml $TGT_URL $conf_file" ALIVE_STRING="chromium" KILL_CMD="pkill chromium" CLEANUP_CMD="kiosk_cleanup" - debuglog "URL is an HTML file. Command is $HTML_APP_CMD" + debuglog "URL is an HTML file. Command is $APP_CMD" fi } diff --git a/usr/local/bin/kiosk_viewhtml b/usr/local/bin/kiosk_viewhtml index 8dd4c1a..b51ac7e 100755 --- a/usr/local/bin/kiosk_viewhtml +++ b/usr/local/bin/kiosk_viewhtml @@ -3,15 +3,18 @@ if [ "$1" = "" ] then - "You must supply a URL as an argument" + "usage: kiosk_viewhtml " exit 1 fi -source /etc/openkiosk.conf +url="$1" +conf_file="$2" + +source $conf_file if ! chromium --test-type --ignore-certificate-errors --kiosk \ --no-first-run --check-for-update-interval=1 --simulate-upgrade \ ---incognito $1 +--incognito $url then kiosk_cleanup.sh xmessage -buttons "Ok:1" -center "Failed to retrieve web page." diff --git a/usr/local/bin/kiosk_viewpdf b/usr/local/bin/kiosk_viewpdf index c7c0690..f397995 100755 --- a/usr/local/bin/kiosk_viewpdf +++ b/usr/local/bin/kiosk_viewpdf @@ -3,18 +3,21 @@ if [ "$1" = "" ] then - "You must supply a URL as an argument" + "usage: kiosk_viewpdf " exit 1 fi -source /etc/openkiosk.conf +url="$1" +conf_file="$2" -if echo "$1" | grep -q '^file:' +source $conf_file + +if echo "$url" | grep -q '^file:' then filepath=$(echo "$server_url"|cut -d"/" -f2-) xpdf -fullscreen -cont -z width $filepath else - if ! wget -q -O /dev/shm/target.pdf $1 + if ! wget -q -O /dev/shm/target.pdf $url then kiosk_cleanup.sh xmessage -buttons "Ok:1" -center "Failed to retrieve pdf file."