Last active
June 8, 2023 08:00
-
-
Save pacmac/8a60937b275fcb21f29e11f1e0901871 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# | |
## bash <(curl -Ls https://gist.githubusercontent.com/pacmac/8a60937b275fcb21f29e11f1e0901871/raw/debian-kiosk.sh) | |
# Add new user | |
useradd -m kiosk-user | |
# Update and install necessary packages | |
apt-get update | |
apt-get install -y \ | |
sudo \ | |
xorg \ | |
chromium \ | |
openbox \ | |
lightdm \ | |
plymouth \ | |
plymouth-themes \ | |
cockpit \ | |
cockpit-podman | |
# Add entry to /etc/containers/registries.conf | |
echo "unqualified-search-registries = ['docker.io']" >> /etc/containers/registries.conf; | |
# Set the default Plymouth theme | |
plymouth-set-default-theme -R | |
# Update grub to hide boot messages and show Plymouth theme | |
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/g' /etc/default/grub | |
sed -i 's/#GRUB_TERMINAL/GRUB_TERMINAL/g' /etc/default/grub | |
# Hide the GRUB menu and disable recovery mode | |
echo "GRUB_DISABLE_RECOVERY=true" >> /etc/default/grub | |
echo "GRUB_TIMEOUT=0" >> /etc/default/grub | |
echo "GRUB_HIDDEN_TIMEOUT=0" >> /etc/default/grub | |
echo "GRUB_HIDDEN_TIMEOUT_QUIET=true" >> /etc/default/grub | |
# Update Grub | |
update-grub | |
# Backup the original lightdm.conf file | |
mv /etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf.orig | |
# Add new lightdm configuration | |
echo "[SeatDefaults]" > /etc/lightdm/lightdm.conf | |
echo "autologin-user=kiosk-user" >> /etc/lightdm/lightdm.conf | |
echo "user-session=openbox" >> /etc/lightdm/lightdm.conf | |
# Create openbox configuration directory for the new user | |
su - kiosk-user -c "mkdir -p ~/.config/openbox" | |
# Create autostart file with chromium startup command for the new user | |
su - kiosk-user -c "cat << EOF > ~/.config/openbox/autostart | |
chromium \ | |
--no-first-run \ | |
--disable \ | |
--disable-translate \ | |
--disable-infobars \ | |
--disable-suggestions-service \ | |
--disable-save-password-bubble \ | |
--start-maximized \ | |
--kiosk 'http://www.google.com' & | |
EOF" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment