#!/bin/bash VNC_ENABLED=$(get-ini /boot/kioskbrowser.ini vnc enabled) if [ "${VNC_ENABLED}" -eq 1 ] then x11vnc -localhost & fi # move the cursor out of the way xdotool mousemove 0 0 xset s off # don't activate screensaver xset -dpms # disable DPMS (Energy Star) features. xset s noblank # don't blank the video device # hide mouse cursor after 1 second unclutter -idle 1 -root & # set a custom resolution (if specified) RESOLUTION=$(get-ini /boot/kioskbrowser.ini screen force_resolution) if [ -n "${RESOLUTION}" ] then MONITOR=$(xrandr -q | grep " connected" | awk '{ print $1; }') xrandr --output "${MONITOR}" --mode "${RESOLUTION}" fi # set a custom modeline (if specified) CUSTOM_MODELINE=$(get-ini /boot/kioskbrowser.ini screen custom_modeline) if [ -n "${CUSTOM_MODELINE}" ] then MONITOR=$(xrandr -q | grep " connected" | awk '{ print $1; }') xrandr --newmode "custom" ${CUSTOM_MODELINE} xrandr --addmode "${MONITOR}" "custom" xrandr --output "${MONITOR}" --mode "custom" fi # set a screen rotation (if specified) ROTATE_SCREEN=$(get-ini /boot/kioskbrowser.ini screen rotate_screen) if [ -n "${ROTATE_SCREEN}" ] then MONITOR=$(xrandr -q | grep " connected" | awk '{ print $1; }') xrandr --output "${MONITOR}" --rotate ${ROTATE_SCREEN} fi # start chromium URL=$(get-ini /boot/kioskbrowser.ini browser url) chromium --start-fullscreen \ --allow-insecure-localhost \ --autoplay-policy=no-user-gesture-required \ --check-for-update-interval=1 \ --disable-component-update \ --disable-features=Translate \ --disable-infobars \ --disable-pinch \ --disable-session-crashed-bubble \ --kiosk \ --noerrdialogs \ --overscroll-history-navigation=0 \ --simulate-critical-update \ --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' \ --touch-events=enabled \ ${URL} & # if a cache clearing interval is specified, launch the cache-clear-timer (while true, sleep, rm -rf) CACHE_CLEAR=$(get-ini /boot/kioskbrowser.ini browser cache_clear_interval) if [ -n "${CACHE_CLEAR}" ] then /usr/bin/cache-clear-timer "${CACHE_CLEAR}" & fi