aericktoes

dv11p-rot

May 13th, 2020
2,549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #/usr/local/bin/rot
  2.  
  3. #!/bin/bash
  4.  
  5. orientation=$(xrandr --query --verbose | grep "eDP-1" | cut -d ' ' -f 6)
  6.  
  7. echo "$1"
  8.  
  9. if [[ "$1" == "toggle" ]]; then
  10.     if [[ "$orientation" == "normal" ]]; then
  11.         rotate left
  12.     else
  13.         rotate normal
  14.     fi
  15.     exit 0
  16. elif [[ "$1" == "invert" ]]; then
  17.     if [[ "$orientation" == "normal" ]]; then
  18.                 rotate invert
  19.         else
  20.                 rotate normal
  21.         fi
  22.     exit 0
  23. else
  24.     echo "Invalid command"
  25.     exit 2
  26. fi
Advertisement
Add Comment
Please, Sign In to add comment