scripts/display-conf.sh

51 lines
891 B
Bash
Raw Normal View History

2024-02-28 10:04:05 +00:00
#!/bin/bash
intern="eDP-1-1"
extern="HDMI-1-1"
reset_displays(){
xrandr --output $intern --off
xrandr --output $extern --off
}
set_all(){
reset_displays
xrandr --output $intern --auto
xrandr --output $extern --left-of $intern --auto
}
set_intern(){
reset_displays
xrandr --output $intern --auto
xrandr --output $extern --off
}
set_extern(){
reset_displays
xrandr --output $intern --off
xrandr --output $extern --auto
}
tog=0
if [ "$1" == "-a" ]
then
set_all
elif [ "$1" == "-i" ]
then
set_intern
elif [ "$1" == "-e" ]
then
set_extern
elif [ "$1" == "-t" ]
then
if [ "$tog" lt "2" ]; then tog=$((tog+1)) ;fi
if [ "$tog" gt "2"]; then tog=0 ;fi
if [ "$tog" == "0" ]; then set_all ;fi
if [ "$tog" == "1" ]; then set_intern ;fi
if [ "$tog" == "2" ]; then set_extern;fi
else
echo $'display-conf [ARGUMENT] \n Arguments: \n -i : intern \n -e : extern \n -a: all'
fi