init
This commit is contained in:
50
display-conf.sh
Executable file
50
display-conf.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user