Merge pull request #1 from karl0ss/add_screen_rotation

Add screen rotation
This commit is contained in:
Karl0ss 2025-04-11 12:35:58 +01:00 committed by GitHub
commit 1d7c60ff8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,8 @@ hostname = "kioskpi"
;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"
; can be used for forcing screen rotation on raspberry pi boards (normal, left, right, inverted)
;rotate_screen = "normal"
[wifi]
; If you need more complex WiFi settings (like WPA2-Enterprise, hidden SSIDs, etc.)

View File

@ -34,6 +34,14 @@ then
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 \