Created
January 14, 2022 09:18
-
-
Save scturtle/68b81677b25a5ebfeaef49b3237c445a to your computer and use it in GitHub Desktop.
xrandr.sh
This file contains 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/bash | |
# xrandr # to see infos | |
# arandr # gui | |
echo -n "builtin(1) external(2) sidebyside(3) mirror(4): " | |
read choice | |
BUI=`xrandr | grep ' connected' | awk 'NR==1 {print $1}'` | |
BUIMODE=`xrandr | grep $BUI -A1 | awk 'FNR==2 {print $1}'` | |
EXT=`xrandr | grep ' connected' | awk 'NR==2 {print $1}'` | |
EXTMODE=`xrandr | grep $EXT -A1 | awk 'FNR==2 {print $1}'` | |
case $choice in | |
1) | |
xrandr --output $EXT --off --output $BUI --mode $BUIMODE | |
;; | |
2) | |
xrandr --output $EXT --mode $EXTMODE --output $BUI --off | |
;; | |
3) | |
xrandr --output $EXT --mode $EXTMODE --output $BUI --mode $BUIMODE --left-of $EXT # right-of, left-of, above, below | |
;; | |
4) | |
xrandr --output $EXT --mode $EXTMODE --scale 0.711x0.711 --same-as $BUI --output $BUI --mode $BUIMODE | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment