Update first-boot.sh and associated scripts to transition from KDE Plasma to rpd-labwc for the Chromium kiosk setup. Modify package installations, LightDM session configurations, and one-shot scripts for wallpaper and rotation to support Wayland. Implement boot order configuration for network-first provisioning. Enhance logging and error handling throughout the scripts.
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
#!/bin/bash
|
||||
# One-shot: set DSI-1 (reTerminal DM) rotation to Right, then remove self. Runs as user pi at first login.
|
||||
# Logs to /var/log/first-boot.log (same as first-boot.sh).
|
||||
# One-shot: set reTerminal DM (labwc/Wayland) rotation to Right via wlr-randr, then remove self.
|
||||
# Runs as user pi at first login. Logs to /var/log/first-boot.log.
|
||||
FIRST_BOOT_LOG="/var/log/first-boot.log"
|
||||
log() { echo "[$(date -Iseconds)] [set-rotation-once] $*" >> "$FIRST_BOOT_LOG" 2>/dev/null || true; }
|
||||
|
||||
export DISPLAY=:0
|
||||
log "started (DISPLAY=$DISPLAY)"
|
||||
log "waiting 5s for display ..."
|
||||
log "started (labwc/wlr-randr)"
|
||||
log "waiting 5s for compositor ..."
|
||||
sleep 5
|
||||
log "running kscreen-doctor output.DSI-1.rotation.right"
|
||||
kscreen-doctor output.DSI-1.rotation.right 2>&1 | while read -r line; do log "$line"; done
|
||||
|
||||
OUTPUT=""
|
||||
if command -v wlr-randr &>/dev/null; then
|
||||
OUTPUT=$(wlr-randr 2>/dev/null | awk '/^[A-Za-z0-9_-]+ /{print $1; exit}')
|
||||
fi
|
||||
if [[ -z "$OUTPUT" ]]; then
|
||||
OUTPUT="DSI-1"
|
||||
log "using default output: $OUTPUT"
|
||||
fi
|
||||
|
||||
if [[ -n "$OUTPUT" ]] && command -v wlr-randr &>/dev/null; then
|
||||
log "applying rotation right (transform 90) on $OUTPUT"
|
||||
wlr-randr --output "$OUTPUT" --transform 90 2>&1 | while read -r line; do log "$line"; done
|
||||
else
|
||||
log "WARNING: wlr-randr not found or no output"
|
||||
fi
|
||||
|
||||
log "removing one-shot desktop and script"
|
||||
rm -f /home/pi/.config/autostart/set-rotation-once.desktop /home/pi/set-rotation-once.sh
|
||||
log "finished"
|
||||
|
||||
Reference in New Issue
Block a user