Skip to content

Instantly share code, notes, and snippets.

@bnnk
Forked from mauro-moreno/kiosker.sh
Last active November 26, 2022 05:34
Show Gist options
  • Save bnnk/d8230fbd4deb8c5b93fd1f8fef6ac9d3 to your computer and use it in GitHub Desktop.
Save bnnk/d8230fbd4deb8c5b93fd1f8fef6ac9d3 to your computer and use it in GitHub Desktop.
My fork running tic80 instead of chrome.
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo 'user ALL=(ALL:ALL) ALL' >> /etc/sudoers
cat <<EOT >> /opt/kiosk.sh
#!/bin/bash
xhost +
xset -dpms
xset s off
matchbox-window-manager -use_cursor no -use_titlebar no &
start-pulseaudio-x11
while true; do
rm -rf ~/.{config,cache}/google-chrome/
tic80 --fullscreen --fs /home/tic80-data --vsync
sleep 1s
done
EOT
chmod +x /opt/kiosk.sh
cat <<EOT >> /lib/systemd/system/kiosk.service
[Unit]
Description=Kiosk service
After=network-online.target
[Service]
Restart=always
User=user
Group=user
ExecStart=/bin/bash -ec "xinit /opt/kiosk.sh -- -nocursor"
[Install]
WantedBy=multi-user.target
EOT
sed -i -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
systemctl enable /lib/systemd/system/kiosk.service
systemctl start kiosk.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment