107 lines
3.6 KiB
Desktop File
107 lines
3.6 KiB
Desktop File
[Unit]
|
|
Description=MYP Kiosk Browser Autostart (Chromium HTTPS)
|
|
Documentation=https://github.com/MYP-Druckerverwaltung
|
|
After=graphical-session.target myp-https.service
|
|
Wants=myp-https.service
|
|
Requires=graphical-session.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=kiosk
|
|
Group=kiosk
|
|
Environment=DISPLAY=:0
|
|
Environment=XAUTHORITY=/home/kiosk/.Xauthority
|
|
WorkingDirectory=/home/kiosk
|
|
|
|
# Warte auf HTTPS-Backend und starte dann Chromium
|
|
ExecStartPre=/bin/bash -c 'echo "Warte auf HTTPS Backend..."; for i in {1..60}; do if curl -k -s https://localhost:443 >/dev/null 2>&1; then echo "HTTPS Backend erreichbar"; break; fi; echo "Warte... ($i/60)"; sleep 2; done'
|
|
ExecStart=/bin/bash -c '\
|
|
# Bildschirmauflösung ermitteln \
|
|
RESOLUTION=$(DISPLAY=:0 xrandr 2>/dev/null | grep "*" | head -1 | awk "{print \$1}" || echo "1920x1080"); \
|
|
WIDTH=$(echo $RESOLUTION | cut -d"x" -f1); \
|
|
HEIGHT=$(echo $RESOLUTION | cut -d"x" -f2); \
|
|
echo "Erkannte Auflösung: ${WIDTH}x${HEIGHT}"; \
|
|
\
|
|
# Bildschirmschoner deaktivieren \
|
|
DISPLAY=:0 xset s off; \
|
|
DISPLAY=:0 xset s noblank; \
|
|
DISPLAY=:0 xset -dpms; \
|
|
\
|
|
# Mauszeiger verstecken \
|
|
DISPLAY=:0 unclutter -idle 0.1 -root -noevents & \
|
|
\
|
|
# Chromium Kiosk-Modus starten \
|
|
if command -v chromium >/dev/null 2>&1; then \
|
|
BROWSER="chromium"; \
|
|
elif command -v chromium-browser >/dev/null 2>&1; then \
|
|
BROWSER="chromium-browser"; \
|
|
else \
|
|
echo "Kein Chromium gefunden - verwende Firefox"; \
|
|
BROWSER="firefox-esr"; \
|
|
fi; \
|
|
\
|
|
echo "Starte $BROWSER im Kiosk-Modus..."; \
|
|
\
|
|
if [[ "$BROWSER" == "chromium"* ]]; then \
|
|
exec $BROWSER \
|
|
--kiosk \
|
|
--no-sandbox \
|
|
--disable-infobars \
|
|
--disable-session-crashed-bubble \
|
|
--disable-restore-session-state \
|
|
--disable-features=TranslateUI \
|
|
--disable-extensions \
|
|
--disable-plugins \
|
|
--disable-popup-blocking \
|
|
--disable-prompt-on-repost \
|
|
--disable-sync \
|
|
--disable-translate \
|
|
--noerrdialogs \
|
|
--no-first-run \
|
|
--no-default-browser-check \
|
|
--autoplay-policy=no-user-gesture-required \
|
|
--start-fullscreen \
|
|
--start-maximized \
|
|
--window-size=${WIDTH},${HEIGHT} \
|
|
--window-position=0,0 \
|
|
--user-data-dir=/home/kiosk/.chromium-kiosk \
|
|
--disable-background-mode \
|
|
--force-device-scale-factor=1.0 \
|
|
--disable-pinch \
|
|
--overscroll-history-navigation=0 \
|
|
--disable-dev-shm-usage \
|
|
--memory-pressure-off \
|
|
--max_old_space_size=512 \
|
|
--disable-background-timer-throttling \
|
|
--disable-backgrounding-occluded-windows \
|
|
--disable-renderer-backgrounding \
|
|
--disable-features=VizDisplayCompositor \
|
|
--enable-features=OverlayScrollbar \
|
|
--hide-scrollbars \
|
|
--ignore-certificate-errors \
|
|
--ignore-ssl-errors \
|
|
--ignore-certificate-errors-spki-list \
|
|
--disable-web-security \
|
|
--allow-running-insecure-content \
|
|
--unsafely-treat-insecure-origin-as-secure=https://localhost:443 \
|
|
https://localhost:443; \
|
|
else \
|
|
exec firefox-esr \
|
|
--kiosk \
|
|
--width=${WIDTH} \
|
|
--height=${HEIGHT} \
|
|
https://localhost:443; \
|
|
fi'
|
|
|
|
Restart=always
|
|
RestartSec=15
|
|
StartLimitBurst=3
|
|
StartLimitInterval=300
|
|
|
|
# Logging
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=myp-kiosk
|
|
|
|
[Install]
|
|
WantedBy=graphical-session.target |