aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-01-12 22:55:55 +0530
committerAkshay Nair <phenax5@gmail.com>2024-01-12 22:55:55 +0530
commitfba2849d709fcafa500ca2392e58b15255f4ef5b (patch)
tree840c6ae2665f8a303f6409107589c46dd07c8eaf /scripts
parentf8c843475febec17faf275e49726ca470b82acab (diff)
downloadnixos-config-fba2849d709fcafa500ca2392e58b15255f4ef5b.tar.gz
nixos-config-fba2849d709fcafa500ca2392e58b15255f4ef5b.zip
new laptop, new me
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/monitor.sh9
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 ;;