Refactor first-boot rotation setup to use kernel command line for persistent display rotation. Update documentation to clarify the new method of setting screen orientation (90° clockwise) via cmdline.txt, eliminating the need for one-shot scripts. Enhance logging and user guidance for rotation and wallpaper configuration during first boot.
This commit is contained in:
@@ -26,11 +26,18 @@ if [[ -f /etc/plymouth/plymouthd.conf ]]; then
|
||||
fi
|
||||
update-initramfs -u -k all 2>/dev/null || true
|
||||
|
||||
echo "=== Rotation and wallpaper (rpd-labwc / labwc Wayland) ==="
|
||||
echo "To set rotation and wallpaper now (in a labwc session), run as $PI_USER:"
|
||||
echo " wlr-randr --output \$(wlr-randr | awk '/^[A-Za-z0-9_-]+ /{print \$1; exit}') --transform 270"
|
||||
echo "=== Rotation (persistent via kernel cmdline) ==="
|
||||
CMDLINE_PATH="/boot/firmware/cmdline.txt"
|
||||
[[ -f "$CMDLINE_PATH" ]] || CMDLINE_PATH="/boot/cmdline.txt"
|
||||
if [[ -f "$CMDLINE_PATH" ]] && ! grep -q 'video=DSI-1:rotate=' "$CMDLINE_PATH"; then
|
||||
sed -i 's/$/ video=DSI-1:rotate=90/' "$CMDLINE_PATH"
|
||||
echo "Added video=DSI-1:rotate=90 to $CMDLINE_PATH (90° clockwise). Reboot to apply."
|
||||
else
|
||||
echo "Rotation already set in cmdline or file missing. Current: $(grep -o 'video=DSI-1:rotate=[^ ]*' "$CMDLINE_PATH" 2>/dev/null || true)"
|
||||
fi
|
||||
echo ""
|
||||
echo "=== Wallpaper (in labwc session, as $PI_USER) ==="
|
||||
echo " pcmanfm --set-wallpaper /usr/share/rpd-wallpaper/splash.png --wallpaper-mode=crop"
|
||||
echo ""
|
||||
echo "Or ensure one-shots run at next login (they are in autostart if still present)."
|
||||
echo "=== Reboot to apply splash and initramfs ==="
|
||||
echo "=== Reboot to apply splash, initramfs and rotation ==="
|
||||
echo " sudo reboot"
|
||||
|
||||
Reference in New Issue
Block a user