#!/bin/bash # Configure l'auto-login et le mode kiosk pour le photobooth # A executer en root set -e USER="jules" echo "--- Configuration auto-login getty ---" # Auto-login sur tty1 via systemd override mkdir -p /etc/systemd/system/getty@tty1.service.d cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf < "$BASH_PROFILE" <<'BASHEOF' # Auto-start X sur tty1 pour le photobooth kiosk if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then exec startx -- -nocursor fi BASHEOF chown "$USER:$USER" "$BASH_PROFILE" # .xinitrc lance le photobooth en plein ecran XINITRC="/home/$USER/.xinitrc" cat > "$XINITRC" <<'XEOF' #!/bin/bash # Desactiver l'ecran de veille et le DPMS xset s off xset -dpms xset s noblank # Rotation ecran si necessaire (decommenter et ajuster) # xrandr --output eDP-1 --rotate right # Attendre le demarrage du backend sleep 2 # Lancer Chromium en mode kiosk exec chromium \ --kiosk \ --noerrdialogs \ --disable-infobars \ --disable-translate \ --disable-features=TranslateUI \ --disable-session-crashed-bubble \ --disable-component-update \ --check-for-update-interval=31536000 \ --autoplay-policy=no-user-gesture-required \ --start-fullscreen \ --incognito \ --touch-events=enabled \ --enable-touch-drag-drop \ http://localhost:8080 XEOF chown "$USER:$USER" "$XINITRC" chmod +x "$XINITRC" # Installer xinit si absent apt install -y xinit x11-xserver-utils echo "--- Kiosk configure ---" echo "Au prochain reboot, le photobooth demarrera automatiquement."