Files
ha-kiosk-dashboard/rotate-now.sh
2025-12-31 04:26:55 -08:00

35 lines
1.2 KiB
Bash

#!/bin/bash
# Immediate rotation test - run this from your graphical terminal
# Try xrandr first (for X11)
if command -v xrandr &> /dev/null; then
DISPLAY_NAME=$(xrandr --query 2>/dev/null | grep " connected" | head -n 1 | cut -d" " -f1)
if [ -n "$DISPLAY_NAME" ]; then
echo "Rotating display $DISPLAY_NAME left (90 degrees)..."
xrandr --output "$DISPLAY_NAME" --rotate left
echo "Done! Check your screen."
exit 0
fi
fi
# For Wayland, try wlr-randr
if command -v wlr-randr &> /dev/null; then
OUTPUT=$(wlr-randr | grep -m 1 "^.*" | cut -d' ' -f1)
if [ -n "$OUTPUT" ]; then
echo "Rotating display $OUTPUT 90 degrees (Wayland)..."
wlr-randr --output "$OUTPUT" --transform 90
echo "Done! Check your screen."
exit 0
fi
fi
# For GNOME Wayland, use gsettings
if command -v gsettings &> /dev/null; then
echo "Attempting GNOME Wayland rotation..."
# Note: GNOME doesn't have a direct gsettings command for rotation
# You may need to use Settings > Displays > Orientation
echo "For Wayland, please use: Settings > Displays > Orientation > Portrait"
fi
echo "Could not automatically rotate. Please check your display settings manually."