Skip to content

Instantly share code, notes, and snippets.

@JSONOrona
Forked from HonbraDev/remove.sh
Created June 17, 2024 21:09
Show Gist options
  • Save JSONOrona/2effa5de71056cec3ee5f7c5ad8eb7d9 to your computer and use it in GitHub Desktop.
Save JSONOrona/2effa5de71056cec3ee5f7c5ad8eb7d9 to your computer and use it in GitHub Desktop.
Ubuntu Server 20.04 LTS Firefox kiosk
# Stop the kiosk service
sudo systemctl stop kiosk
# Remove the kiosk service from startup
sudo systemctl disable kiosk
# Remove the kiosk service
sudo rm -f /etc/systemd/system/kiosk.service
# Reload systemctl daemons
sudo systemctl daemon-reload
# Remove the kiosk startup file and directory
sudo rm -rf /opt/kiosk
# Remove X.org, OpenBox, Firefox and autoremove associated programs no longer in use
sudo apt remove --autoremove -y xorg openbox firefox
# Install X.org, OpenBox, Firefox
sudo apt install --no-install-recommends -y xorg openbox firefox
# Write X.org startup script to /opt/kiosk/kiosk.sh
sudo mkdir /opt/kiosk
echo "xset s
xset -dpms
off openbox-session &
while true;
do
/usr/bin/firefox --kiosk --private-window 'https://honbra.com/'
done" | sudo tee /opt/kiosk/kiosk.sh
# Write service file to /etc/systemd/system/kiosk.service
echo "[Unit]
Description=Start kiosk
[Service]
Type=simple
ExecStart=sudo startx /etc/X11/Xsession /opt/kiosk/kiosk.sh
[Install]
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/kiosk.service
# Add permissions to the files
sudo chmod 644 /etc/systemd/system/kiosk.service
sudo chmod +x /opt/kiosk/kiosk.sh
# Enable the service on startup
sudo systemctl daemon-reload
sudo systemctl enable kiosk
# Finish
echo "Edit /etc/systemd/system/kiosk.service to change the website.
Run 'sudo systemctl start kiosk' to start the kiosk
Thanks for using the Kiosk gist by @HonbraDev :)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment