diff options
| author | BossCode45 <boss@tehbox.org> | 2025-05-09 11:27:42 +1200 |
|---|---|---|
| committer | BossCode45 <boss@tehbox.org> | 2025-05-09 11:30:29 +1200 |
| commit | 7072cf1bdf2b8e4183ccb0247d8c5fa266ae315f (patch) | |
| tree | cde5b9785060504e680b0e1acc468849dfd6145c /home-manager/i3/scripts/monitor-config.sh | |
| parent | cd74ab83ed8215dfc87e538395ee9af56a56c893 (diff) | |
| download | nixos-configuration-7072cf1bdf2b8e4183ccb0247d8c5fa266ae315f.tar.gz nixos-configuration-7072cf1bdf2b8e4183ccb0247d8c5fa266ae315f.zip | |
Initial commit
Diffstat (limited to 'home-manager/i3/scripts/monitor-config.sh')
| -rwxr-xr-x | home-manager/i3/scripts/monitor-config.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/home-manager/i3/scripts/monitor-config.sh b/home-manager/i3/scripts/monitor-config.sh new file mode 100755 index 0000000..8f17660 --- /dev/null +++ b/home-manager/i3/scripts/monitor-config.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +choice=$(echo -e "One monitor\nTwo monitors" | rofi -dmenu -i -p "What monitor setup to use") + +monitor1=$(xrandr | grep -E "eDP(-1(-1)?)?" | awk '{print $1 }') +monitor2=$(xrandr | grep -E "HDMI(-A-0)?(-1(-1)?)?" | awk '{print $1 }') + +case $choice in + "One monitor") + xrandr --output $monitor1 --primary --mode 1920x1080 --rate 144 --pos 0x0 --rotate normal --output $monitor2 --off + sleep 1 + i3-msg restart + ;; + "Two monitors") + xrandr --output $monitor1 --primary --mode 1920x1080 --rate 144 --pos 0x0 --rotate normal --output $monitor2 --mode 1920x1080 --rate 144 --pos 1920x0 --rotate normal + sleep 1 + i3-msg restart + ;; + *) + notify-send "Invalid response, canceling" + ;; +esac + |
