kiosk: add support for custom modelines

This commit is contained in:
Manawyrm 2024-03-10 16:07:52 +01:00
parent 09e631a7a9
commit 326a1426c3
3 changed files with 15 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
raspikiosk.img
raspios.img.xz
work/
.DS_Store

View File

@ -5,6 +5,8 @@ hostname = "kioskpi"
[screen]
; can be used to force 1080p on 4k screens or workaround broken EDID communication
;force_resolution = "1920x1080"
; force a custom modelines (for specialty diplays like embedded monitors, car screens, etc.)
;custom_modeline = "40.141 1024 1032 1064 1104 600 604 612 618 +HSync -VSync"
[wifi]
; If you need more complex WiFi settings (like WPA2-Enterprise, hidden SSIDs, etc.)
@ -16,7 +18,7 @@ ssid="My WiFi"
psk="My Passphrase"
[browser]
url="https://tbspace.de/"
url="https://kittenlabs.de/"
; clear the browser cache every 10 minutes
cache_clear_interval=600
@ -37,7 +39,7 @@ enabled=0
; autossh can be used to keep a connection to a specified SSH server up-and-running to allow for remote access
; without the need for port forwarding, public IPv4 addressing, dynamic DNS, etc.
enabled=0
args = "-p 22 -R 1234:127.0.0.1:22 tunnel@mydomain.de"
args = "-p 22 -R 1234:127.0.0.1:22 tunnel@example.com"
; security warning: ensure sshd_config "GatewayPorts" is set to "clientspecified" or "no".
; GatewayPorts=yes will cause the kioskpi to be globally bound (0.0.0.0, regardless of the bind-address specified above) and be reachable from the internet!
; This might be a huge risk.

View File

@ -24,6 +24,16 @@ then
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
# start chromium
URL=$(get-ini /boot/kioskbrowser.ini browser url)
chromium --start-fullscreen \