Skip to content

Instantly share code, notes, and snippets.

@sainak
Created April 16, 2021 12:43
Show Gist options
  • Save sainak/ad0c88a6183fdd3c2c610252d1df986a to your computer and use it in GitHub Desktop.
Save sainak/ad0c88a6183fdd3c2c610252d1df986a to your computer and use it in GitHub Desktop.
a script to rotate screen by 180 degrees on linux
#!/bin/bash
# Location for file to save rotation state
TOGGLE=/tmp/.toggle
if [ ! -e $TOGGLE ]; then
touch $TOGGLE
xrandr -o inverted
else
rm $TOGGLE
xrandr -o normal
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment