aboutsummaryrefslogtreecommitdiff
path: root/modules/home-manager/i3/scripts/monitor-config.sh
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-10-17 21:53:43 +1300
committerDylan <boss@tehbox.org>2026-10-17 21:53:43 +1300
commit280e1bbe5e733128a451260685cc8ecd10a042a3 (patch)
tree78bab82353bbfa00f9a781015e246c274a5c983b /modules/home-manager/i3/scripts/monitor-config.sh
parentbcfc69e424802276cc52fb6e00fb4a42e9c37816 (diff)
downloadnixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.tar.gz
nixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.zip
feat: Dendritic pattern
This re-write was done with the help of claude, and still needs a decent amount of changes before it properly follows the dendritic pattern
Diffstat (limited to 'modules/home-manager/i3/scripts/monitor-config.sh')
-rwxr-xr-xmodules/home-manager/i3/scripts/monitor-config.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/home-manager/i3/scripts/monitor-config.sh b/modules/home-manager/i3/scripts/monitor-config.sh
new file mode 100755
index 0000000..8f17660
--- /dev/null
+++ b/modules/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
+