Add hostname setup and kiosk mode to install

This commit is contained in:
Chris Wanstrath 2026-02-25 20:44:05 -08:00
parent 029e349c5b
commit b0c5a11cde

View File

@ -31,15 +31,6 @@ if ! sudo -n true 2>/dev/null; then
exit 1
fi
# -- Hostname --
CURRENT_HOSTNAME=$(hostname)
if [ "$CURRENT_HOSTNAME" != "toes" ]; then
echo ">> Setting hostname to 'toes' (was '$CURRENT_HOSTNAME')"
sudo hostnamectl set-hostname toes
sudo sed -i "s/$CURRENT_HOSTNAME/toes/g" /etc/hosts
fi
# -- System packages --
echo ">> Updating system packages"
@ -120,36 +111,9 @@ sudo systemctl enable toes
echo ">> Starting toes"
sudo systemctl restart toes
# -- Kiosk mode --
echo ">> Enabling kiosk mode"
sudo raspi-config nonint do_boot_behaviour B4 2>/dev/null || true
mkdir -p ~/.config/labwc
cat > ~/.config/labwc/autostart <<'EOF'
chromium --noerrdialogs --disable-infobars --kiosk http://localhost
EOF
WAYFIRE_CONFIG="$HOME/.config/wayfire.ini"
if [ -f "$WAYFIRE_CONFIG" ]; then
sed -i '/^chromium = /d' "$WAYFIRE_CONFIG"
if grep -q '^\[autostart\]' "$WAYFIRE_CONFIG"; then
sed -i '/^\[autostart\]/a chromium = chromium --noerrdialogs --disable-infobars --kiosk http://localhost' "$WAYFIRE_CONFIG"
else
cat >> "$WAYFIRE_CONFIG" <<'EOF'
[autostart]
chromium = chromium --noerrdialogs --disable-infobars --kiosk http://localhost
EOF
fi
fi
# -- Done --
echo ""
echo " toes is installed! Rebooting in 5 seconds..."
echo " After reboot, visit: http://toes.local"
echo " toes is installed and running!"
echo " Visit: http://$(hostname).local"
echo ""
sleep 5
sudo nohup reboot >/dev/null 2>&1 &
exit 0