Working Kiosk
This commit is contained in:
33
kiosk.sh
33
kiosk.sh
@ -16,45 +16,22 @@ if ! grep -q "community" /etc/apk/repositories; then
|
||||
fi
|
||||
|
||||
echo "Installing kiosk packages..."
|
||||
apk add chromium xorg-server xinit openbox font-noto unclutter xf86-input-libinput mesa-dri-gallium
|
||||
apk add chromium xorg-server xinit openbox font-noto xf86-input-libinput mesa-dri-gallium
|
||||
|
||||
echo "Creating .xinitrc for kiosk mode"
|
||||
cat << EOF > /root/.xinitrc
|
||||
cat > /root/.xinitrc << EOF
|
||||
#!/bin/sh
|
||||
|
||||
xset -dpms
|
||||
xset s off
|
||||
xset s noblank
|
||||
|
||||
unclutter -idle 1 &
|
||||
|
||||
mkdir -p /root/.config/chromium/Default
|
||||
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /root/.config/chromium/Default/Preferences 2>/dev/null || true
|
||||
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /root/.config/chromium/Default/Preferences 2>/dev/null || true
|
||||
|
||||
while true; do
|
||||
/usr/bin/chromium-browser $KIOSK_URL \\
|
||||
--window-size=1920,1080 \\
|
||||
--window-position=0,0 \\
|
||||
--start-fullscreen \\
|
||||
--kiosk \\
|
||||
--incognito \\
|
||||
--noerrdialogs \\
|
||||
--disable-translate \\
|
||||
--no-first-run \\
|
||||
--fast \\
|
||||
--fast-start \\
|
||||
--disable-infobars \\
|
||||
--disable-features=TranslateUI \\
|
||||
--enable-features=OverlayScrollbars \\
|
||||
--disk-cache-dir=/dev/null \\
|
||||
--overscroll-history-navigation=0 \\
|
||||
--disable-pinch \\
|
||||
--no-sandbox \\
|
||||
--disable-dev-shm-usage \\
|
||||
--disable-sync \\
|
||||
--disable-signin-frame-redirect
|
||||
|
||||
/usr/bin/chromium-browser $KIOSK_URL --window-size=1920,1080 --window-position=0,0 --start-fullscreen --kiosk --incognito --noerrdialogs --disable-translate --no-first-run --fast --fast-start --disable-infobars --disable-features=TranslateUI --enable-features=OverlayScrollbars --disk-cache-dir=/dev/null --overscroll-history-navigation=0 --disable-pinch --no-sandbox --disable-dev-shm-usage --disable-sync --disable-signin-frame-redirect
|
||||
echo "Browser crashed, restarting in 5 seconds..."
|
||||
sleep 5
|
||||
done
|
||||
@ -63,7 +40,7 @@ EOF
|
||||
chmod +x /root/.xinitrc
|
||||
|
||||
echo "Setting up auto-start X11 on boot"
|
||||
cat << 'EOF' > /root/.profile
|
||||
cat > /root/.profile << 'EOF'
|
||||
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
|
||||
exec startx
|
||||
fi
|
||||
@ -77,7 +54,7 @@ fi
|
||||
echo "kiosk" > /etc/hostname
|
||||
|
||||
echo ""
|
||||
echo "Kiosk setup complete! (Script is safe to re-run)"
|
||||
echo "Kiosk setup complete!"
|
||||
echo "URL configured: $KIOSK_URL"
|
||||
echo "Reboot to start kiosk mode: reboot"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user