Update first-boot configuration and scripts for enhanced kiosk functionality</message>
<message>Modify the first-boot configuration to include the gir1.2-gtklayershell-0.1 package for improved GTK layer shell support. Update the first-boot script to enhance the portal status reporting with connection timeouts. Additionally, implement a restart mechanism for the kanshi service in rotation scripts to ensure immediate application of configuration changes. Introduce a Chromium kiosk extension to disable text selection, improving user experience in kiosk mode. These changes streamline the setup process and enhance the overall functionality of the kiosk environment.
This commit is contained in:
@@ -4,6 +4,16 @@
|
||||
step_04_kiosk_files() {
|
||||
mkdir -p "$AUTOSTART" "$PI_HOME/Desktop" "$PI_HOME/.local/share/applications"
|
||||
|
||||
# Extension: disable text selection so touch-drag scrolls
|
||||
EXT_DIR="$PI_HOME/.local/share/chromium-kiosk-no-select"
|
||||
mkdir -p "$EXT_DIR"
|
||||
if curl -fsSL "${FILE_SERVER}/chromium-kiosk-no-select/manifest.json" -o "$EXT_DIR/manifest.json" 2>/dev/null && \
|
||||
curl -fsSL "${FILE_SERVER}/chromium-kiosk-no-select/no-select.css" -o "$EXT_DIR/no-select.css" 2>/dev/null && \
|
||||
curl -fsSL "${FILE_SERVER}/chromium-kiosk-no-select/inject.js" -o "$EXT_DIR/inject.js" 2>/dev/null; then
|
||||
chown -R "$PI_USER:$PI_USER" "$EXT_DIR"
|
||||
log "Chromium kiosk no-select extension installed"
|
||||
fi
|
||||
|
||||
curl -fsSL "${FILE_SERVER}/start-chromium.sh" -o "$PI_HOME/start-chromium.sh"
|
||||
curl -fsSL "${FILE_SERVER}/chromium-kiosk.desktop" -o "$AUTOSTART/chromium-kiosk.desktop"
|
||||
chmod 755 "$PI_HOME/start-chromium.sh"
|
||||
@@ -17,6 +27,8 @@ step_04_kiosk_files() {
|
||||
chmod 755 "$PI_HOME/Desktop/Chromium Kiosk.desktop"
|
||||
chmod 644 "$PI_HOME/.local/share/applications/chromium-kiosk-launcher.desktop"
|
||||
chown "$PI_USER:$PI_USER" "$PI_HOME/Desktop/Chromium Kiosk.desktop" "$PI_HOME/.local/share/applications/chromium-kiosk-launcher.desktop"
|
||||
# Mark as trusted so pcmanfm shows the icon instead of a text file
|
||||
sudo -u "$PI_USER" gio set "$PI_HOME/Desktop/Chromium Kiosk.desktop" metadata::trusted true 2>/dev/null || true
|
||||
rm -f /tmp/chromium-kiosk-launcher.desktop
|
||||
log "Chromium kiosk launcher installed"
|
||||
fi
|
||||
|
||||
@@ -36,4 +36,13 @@ AWAITSVC
|
||||
systemctl daemon-reload
|
||||
systemctl enable cm4-await-display.service 2>/dev/null || true
|
||||
log "cm4-await-display.service installed (wait for DSI, max 30s)"
|
||||
|
||||
# Enable VNC (wayvnc) for remote access
|
||||
if command -v raspi-config >/dev/null 2>&1; then
|
||||
raspi-config nonint do_vnc 0
|
||||
log "VNC (wayvnc) enabled on port 5900"
|
||||
else
|
||||
log "WARNING: raspi-config not found, skipping VNC setup"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,19 @@
|
||||
# Step 11: Install one-shot and per-login scripts
|
||||
|
||||
step_11_oneshots() {
|
||||
# Rotation: install set-rotation-at-login (re-applies kanshi config every login)
|
||||
# Rotation: pre-create kanshi config so it's ready before the desktop session starts,
|
||||
# then install set-rotation-at-login to re-apply on every login.
|
||||
if [[ -n "$DSI_ROTATE" ]]; then
|
||||
log "Rotation $DSI_ROTATE set via cmdline"
|
||||
local kanshi_dir="$PI_HOME/.config/kanshi"
|
||||
mkdir -p "$kanshi_dir"
|
||||
cat > "$kanshi_dir/config" <<KANSHI
|
||||
profile {
|
||||
output DSI-1 enable scale 1.000000 mode 800x1280@60.000 position 0,0 transform $DSI_ROTATE
|
||||
}
|
||||
KANSHI
|
||||
chown -R "$PI_USER:$PI_USER" "$kanshi_dir"
|
||||
log "Pre-created kanshi config (transform $DSI_ROTATE)"
|
||||
if curl -fsSL "${FILE_SERVER}/set-rotation-at-login.sh" -o "$PI_HOME/set-rotation-at-login.sh" 2>/dev/null; then
|
||||
chmod 755 "$PI_HOME/set-rotation-at-login.sh"
|
||||
chown "$PI_USER:$PI_USER" "$PI_HOME/set-rotation-at-login.sh"
|
||||
|
||||
Reference in New Issue
Block a user