Files
dotfiles/utils/.local/bin/drotate
2026-03-09 09:48:55 +08:00

29 lines
640 B
Bash
Executable File

#!/usr/bin/env bash
# X11:
# xrandr --listactivemonitors
# xrandr --output $OUTPUT --rotate (normal|left|right|...)
# Wayland KDE: https://www.reddit.com/r/kde/comments/11vrbwc/how_do_i_rotate_the_screen_on_kde_with_wayland/
# kscreen-doctor --outputs
OUTPUT='HDMI-A-1'
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
cat <<EOF
Usage: $(basename "$0") [-h] [normal|left|right|inverted]
Rotate a display.
Options:
-h, --help Show this help message
Arguments:
normal|left|right|inverted Direction
EOF
exit 0
fi
[ "$1" ] && DIRECTION="$1" || DIRECTION="normal"
kscreen-doctor "output.$OUTPUT.rotation.$DIRECTION"