Skip to content

Instantly share code, notes, and snippets.

@merqurio
Forked from yanbab/setup-kiosk-alpine.sh
Created May 1, 2022 10:49
Show Gist options
  • Save merqurio/c5cc9eab4caff5fe4145ec2c01935e86 to your computer and use it in GitHub Desktop.
Save merqurio/c5cc9eab4caff5fe4145ec2c01935e86 to your computer and use it in GitHub Desktop.
#/bin/sh
#
# Setup Kiosk mode for Alpine Linux
#
#!/bin/sh
USER=kiosk
KEYBOARD_LAYOUT=fr
KEYBOARD_MODEL=mac
WIDTH=1024
HEIGHT=768
BROWSER=chromium
PRIVATE=yes
TABS=yes
URL=https://www.google.com
# Install Xorg
#
setup-xorg-base
apk add xrandr setxkbmap xset xsetroot
# apk add xterm xeyes xcalc
# Enable Community repo
#
# Install Browser
#
apk add chromium
# Automatic login, no VTs, silent boot
#
cp /etc/inittab /etc/inittab.bak
cat << EOF > /etc/inittab
::sysinit:/sbin/openrc -q -C sysinit
::sysinit:/sbin/openrc -q -C boot
::wair:/sbin/openrc -q -C default
tty1::respawn:/bin/login -f kiosk
#tty2::respawn:/sbin/getty 38400 tty2
EOF
# Autostart Xorg
#
cat << EOF > /etc/skel/.profile
startx 2> /dev/null
EOF
# Xorg Session
cat << EOF > /etc/skel/.xinitrc
setxkbmap $KEYBOARD_LAYOUT $KEYBOARD_MODEL
exec chromium-browser
EOF
# Disable Xorg VT Switch
cat << EOF > /etc/X11/xorg.conf
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "DontZap" "true"
EndSection
EOF
# Create user
adduser $USER -D
# Silent Boot
echo "" > /etc/motd
echo "" > /etc/issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment