[Unit]
Description=Michka kiosk (cage + chromium)
After=michka-hub.service systemd-logind.service systemd-user-sessions.service getty@tty1.service
Wants=michka-hub.service
# Starting the kiosk takes tty1 from the console login (and vice-versa for exit-to-login).
Conflicts=getty@tty1.service

[Service]
Type=simple
User=root
PAMName=login
TTYPath=/dev/tty1
StandardInput=tty
StandardOutput=journal
StandardError=journal
UtmpIdentifier=tty1
UtmpMode=user
Environment=XDG_RUNTIME_DIR=/run/user/0
Environment=XDG_SESSION_TYPE=wayland
ExecStartPre=/bin/mkdir -p /run/user/0
ExecStartPre=/bin/chmod 0700 /run/user/0
ExecStart=/usr/bin/cage -- /opt/michka/kiosk.sh
Restart=always
RestartSec=3
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

[Install]
WantedBy=multi-user.target
