diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-01-12 22:55:55 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-01-12 22:55:55 +0530 |
| commit | fba2849d709fcafa500ca2392e58b15255f4ef5b (patch) | |
| tree | 840c6ae2665f8a303f6409107589c46dd07c8eaf /scripts/monitor.sh | |
| parent | f8c843475febec17faf275e49726ca470b82acab (diff) | |
| download | nixos-config-fba2849d709fcafa500ca2392e58b15255f4ef5b.tar.gz nixos-config-fba2849d709fcafa500ca2392e58b15255f4ef5b.zip | |
new laptop, new me
Diffstat (limited to 'scripts/monitor.sh')
| -rwxr-xr-x | scripts/monitor.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/monitor.sh b/scripts/monitor.sh index bc719b9..2660a6b 100755 --- a/scripts/monitor.sh +++ b/scripts/monitor.sh @@ -2,14 +2,15 @@ source "$HOME/scripts/modules/rofi-menu.sh"; -PRIMARY="eDP1"; +PRIMARY="eDP-1"; +SECONDARY_DEFAULT="HDMI-1" list-monitors() { xrandr --listmonitors | grep -v 'Monitors:' | awk '{print $4 " (" $3 ")"}'; } -monitor-off() { xrandr --output ${1:-"HDMI1"} --off; }; +monitor-off() { xrandr --output ${1:-$SECONDARY_DEFAULT} --off; }; monitor-on() { - xrandr --output ${2:-"HDMI1"} --auto --${1:-"right-of"} $PRIMARY; + xrandr --output ${2:-$SECONDARY_DEFAULT} --auto --${1:-"right-of"} $PRIMARY; } show-menu() { @@ -20,7 +21,7 @@ case $1 in ls) list-monitors ;; on) monitor-on "$2" "$3" ;; sidekick) - xrandr --output ${3:-"HDMI1"} --auto --${2:-"left-of"} $PRIMARY --rotate right --brightness 1.5 + xrandr --output ${3:-$SECONDARY_DEFAULT} --auto --${2:-"left-of"} $PRIMARY --rotate right --brightness 1.5 ;; off) monitor-off "$2" ;; menu) show-menu ;; |
