Advertisement
Guest User

My rotation script

a guest
Mar 10th, 2024
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. killall monitor-sensor
  4. while inotifywait -e modify /dev/shm/sensor.log; do
  5.  
  6. ORIENTATION=$(tail /dev/shm/sensor.log | grep 'orientation' | tail -1 | grep -oE '[^ ]+$')
  7.  
  8. case "$ORIENTATION" in
  9. normal)
  10. xrandr -o normal
  11. xinput set-prop "xwayland-tablet stylus" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1;;
  12. right-up)
  13. xrandr -o right
  14. xinput set-prop "xwayland-tablet stylus" --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1;;
  15. left-up)
  16. xrandr -o left
  17. xinput set-prop "xwayland-tablet stylus" --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1;;
  18. bottom-up)
  19. xrandr -o inverted
  20. xinput set-prop "xwayland-tablet stylus" --type=float "Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1;;
  21. esac
  22. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement