Add rotate-now.sh
This commit is contained in:
34
rotate-now.sh
Normal file
34
rotate-now.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/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."
|
||||
Reference in New Issue
Block a user