Skip to content

Instantly share code, notes, and snippets.

@andi34
Forked from HonbraDev/remove.sh
Created August 16, 2023 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andi34/a51299fd19f06cf8ccff16a559dad51c to your computer and use it in GitHub Desktop.
Save andi34/a51299fd19f06cf8ccff16a559dad51c 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