From 46a73dfb9e6c3cf6cec952ad15bfbe4f9a9ae55e Mon Sep 17 00:00:00 2001 From: n0th1ng Date: Thu, 18 Dec 2025 21:20:35 +0100 Subject: [PATCH] Added a systemd service, as well as sway --- post_install.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++--- preseed.cfg | 3 ++- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/post_install.sh b/post_install.sh index 8c9659e..b2fdc19 100644 --- a/post_install.sh +++ b/post_install.sh @@ -1,4 +1,7 @@ printf "[daemon]\nAutomaticLoginEnable=true\nAutomaticLogin=kiosk\n\n[security]\n\n[xdmcp]\n\n[chooser]\n\n[debug]\n" > /etc/gdm3/daemon.conf + + +# Firefox policy mkdir -p /usr/lib/firefox-esr/distribution tee /usr/lib/firefox-esr/distribution/policies.json > /dev/null <<'EOF' { @@ -53,10 +56,55 @@ tee /usr/lib/firefox-esr/distribution/policies.json > /dev/null <<'EOF' } } EOF -chown -R kiosk:kiosk /home/kiosk/.config +# Bash autostart of sway tee /home/kiosk/.bash_profile > /dev/null <<'EOF' if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then - exec cage firefox --kiosk https://c3nav.de + exec sway fi -EOF \ No newline at end of file +EOF + +# Sway config +mkdir -p /home/kiosk/.config/sway/ +tee /home/kiosk/.config/sway/config > /dev/null <<'EOF' +input type:pointer { + events disabled +} + +input type:keyboard { + events disabled +} + +input type:touch { + events enabled +} + +input * xkb_layout de + +## This may not be needed if there is a systemd unit +# exec_always firefox --wayland --kiosk +EOF + + +# Systemd unit +mkdir -p /home/kiosk/.config/systemd/user/ +tee /home/kiosk/.config/systemd/user/firefox-kiosk.service > /dev/null <<'EOF' +service +[Unit] +Description=Firefox im Kiosk-Mode + +[Service] +Type=simple +TimeoutStartSec=0 +ExecStart=/usr/bin/firefox --kiosk +Environment=DISPLAY=:0 +Restart=always + +[Install] +WantedBy=default.target +EOF +mkdir -p /home/kiosk/.config/systemd/user/default.target.wants/ +ln -s /home/kiosk/.config/systemd/user/firefox-kiosk.service /home/kiosk/.config/systemd/user/default.target.wants/firefox-kiosk.service + + +chown -R kiosk:kiosk /home/kiosk/.config \ No newline at end of file diff --git a/preseed.cfg b/preseed.cfg index b934651..9845da0 100644 --- a/preseed.cfg +++ b/preseed.cfg @@ -53,7 +53,8 @@ d-i pkgsel/include string \ sudo \ cage \ firefox-esr \ - curl + curl \ + sway d-i pkgsel/exclude string gnome-software