blob: 93a0282d5cba6cafb3a5359201eb55c900e061f6 (
plain) (
blame)
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
|
#!/bin/bash
source "$HOME/scripts/modules/rofi-menu.sh";
PRIMARY="eDP1";
list-monitors() { xrandr --listmonitors | grep -v 'Monitors:' | awk '{print $4 " (" $3 ")"}'; }
monitor-off() { xrandr --output ${1:-"HDMI-1"} --off; };
monitor-on() {
xrandr --output ${2:-"HDMI-1"} --auto --${1:-"right-of"} $PRIMARY;
}
show-menu() {
list-monitors | open-menu -p "Monitors";
}
case $1 in
ls) list-monitors ;;
on) monitor-on "$2" "$3" ;;
off) monitor-off "$2" ;;
menu) show-menu ;;
*) echo "Fuck off" ;;
esac;
|