Last active
September 17, 2024 13:39
-
-
Save HonbraDev/d6a6c80d97631743f07901ec8918f49c to your computer and use it in GitHub Desktop.
Ubuntu Server 20.04 LTS Firefox kiosk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
You should edit /opt/kiosk/kiosk.sh and add resolution parameters before --private-window. For example if you have 1920x1080 you should have string like this:
/usr/bin/firefox --kiosk --height 1080 --width 1920 --private-window 'https://honbra.com/'