-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathxrandr-set.sh
executable file
·46 lines (39 loc) · 1.21 KB
/
xrandr-set.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
# Dell Latitude 5490
LCD="eDP1"
VGA="VGA1"
HDMI="HDMI1"
LCD_MODE="--auto"
OUT_MODE="--auto"
usage() {
echo "Usage: xrandr_set [output] [command]"
echo ""
echo "Outputs:"
echo " hdmi, vga"
echo ""
echo "Commands:"
echo " above, below, left, right, only, off"
exit 1
}
if [ $# != 2 ]; then
usage
fi
case $1 in
dvi|DVI) OUT=$DVI;;
vga|VGA) OUT=$VGA;;
hdmi|HDMI) OUT=$HDMI;;
*) usage;;
esac
case $2 in
above) xrandr --output $LCD --primary $LCD_MODE --output $OUT $OUT_MODE --above $LCD ;;
below) xrandr --output $LCD --primary $LCD_MODE --output $OUT $OUT_MODE --below $LCD ;;
left) xrandr --output $LCD --primary $LCD_MODE --output $OUT $OUT_MODE --left-of $LCD ;;
right) xrandr --output $LCD --primary $LCD_MODE --output $OUT $OUT_MODE --right-of $LCD;;
only) xrandr --output $LCD --off --output $OUT $OUT_MODE --primary ;;
clone) xrandr --output $LCD --same-as $OUT --auto --output $OUT $OUT_MODE --primary ;;
off) xrandr --output $LCD --primary $LCD_MODE --output $OUT --off ;;
*) usage;;
esac
#rotate-wallpaper
#transset -n i3bar 0.9
#service -u restart polybar