-
-
Save ephemient/3a481a0d8491553ecbd41368d30feeeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -euo pipefail | |
case ${1:-0} in | |
0|normal) rot=normal mat=( 1 0 0 0 1 0 0 0 1) ;; | |
1|left) rot=left mat=( 0 -1 1 1 0 0 0 0 1) ;; | |
2|flip) rot=inverted mat=(-1 0 1 0 -1 1 0 0 1) ;; | |
3|right) rot=right mat=( 0 1 0 -1 0 1 0 0 1) ;; | |
*) | |
echo "Usage: $(basename "$0") [<0|1|2|3>|<normal|left|flip|right>]" >&2 | |
exit | |
;; | |
esac | |
xrandr --output 'eDP-1' --rotate "${rot}" | |
xinput --set-prop "$(xinput list --id-only '04F3200A:00 04F3:2513')" 'Coordinate Transformation Matrix' "${mat[@]}" | |
xinput --set-prop "$(xinput list --id-only '04F3200A:00 04F3:2513 Pen Pen (0)')" 'Coordinate Transformation Matrix' "${mat[@]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Categories=System; | |
Name=Rotate flip | |
TryExec=rot | |
Exec=rot flip | |
Icon=osd-rotate-flip | |
StartupNotify=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Categories=System; | |
Name=Rotate left | |
TryExec=rot | |
Exec=rot left | |
Icon=osd-rotate-ccw | |
StartupNotify=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Categories=System; | |
Name=Rotate normal | |
TryExec=rot | |
Exec=rot normal | |
Icon=osd-rotate-normal | |
StartupNotify=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Application | |
Categories=System; | |
Name=Rotate right | |
TryExec=rot | |
Exec=rot right | |
Icon=osd-rotate-cw | |
StartupNotify=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
xinput --map-to-output "$(xinput list --id-only '04F3200A:00 04F3:2513')" eDP-1 | |
xinput --map-to-output "$(xinput list --id-only '04F3200A:00 04F3:2513 Pen Pen (0)')" eDP-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment