-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathkiosk.sh
More file actions
37 lines (34 loc) · 1.32 KB
/
Copy pathkiosk.sh
File metadata and controls
37 lines (34 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
export XDG_RUNTIME_DIR=/run/user/$(id -u)
export WLR_NO_HARDWARE_CURSORS=1
export XCURSOR_THEME=invisible
export XCURSOR_SIZE=1
export XCURSOR_PATH="$HOME/.icons"
# Clear Chromium cache so stale pages don't stick after reboot
rm -rf "$HOME/.config/chromium/Default/Cache" \
"$HOME/.config/chromium/Default/Code Cache" \
"$HOME/.config/chromium/Default/Service Worker" 2>/dev/null
# Wait for the vinyl-airplay service to be responding before launching the browser
echo "[kiosk] Waiting for vinyl-airplay..."
for i in $(seq 1 60); do
if curl -s -o /dev/null -w '' http://localhost:8080/api/status 2>/dev/null; then
echo "[kiosk] Service is up after ${i}s"
break
fi
sleep 1
done
# Force the touchscreen output to its native 1024x600. The panel returns no EDID
# so wlroots would otherwise default to the first VESA mode (1024x768) and stretch
# the UI vertically. wlr-randr runs inside cage to change the mode before chromium.
cage -d -- bash -c 'wlr-randr --output HDMI-A-2 --mode 1024x600 2>/dev/null; exec chromium \
--kiosk \
--noerrdialogs \
--disable-infobars \
--no-first-run \
--disable-translate \
--disable-features=OverscrollHistoryNavigation \
--disable-pinch \
--autoplay-policy=no-user-gesture-required \
--window-size=1024,600 \
--touch-events=enabled \
http://localhost:8080'