aboutsummaryrefslogtreecommitdiff
path: root/kanshi/dual.sh
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2026-10-23 23:45:35 +0200
committerbozo.kopic <bozo@kopic.xyz>2026-10-23 23:45:35 +0200
commit7ba2f3494fbf93c06364858d6bddd4aefc9924c7 (patch)
tree16c66392edef4b2625a7f93c81b180d38e047270 /kanshi/dual.sh
parentbb2dae2aaafab0bb7f1c1d03dc6ebe10deee0b24 (diff)
.
Diffstat (limited to 'kanshi/dual.sh')
-rwxr-xr-xkanshi/dual.sh45
1 files changed, 33 insertions, 12 deletions
diff --git a/kanshi/dual.sh b/kanshi/dual.sh
index b9c08cf..bda0ff0 100755
--- a/kanshi/dual.sh
+++ b/kanshi/dual.sh
@@ -4,18 +4,39 @@
secondary=$(display_names ".name != \"$primary\"")
-swaymsg -q reload
+wlr-randr --output $primary --pos 0,0
+wlr-randr --output $secondary --right-of $primary
-swaymsg -q output $primary pos 0 0 \
- res $primary_res \
- bg $bg1 stretch
-swaymsg -q output $secondary pos $primary_width 0 \
- bg $bg2 stretch
+killall swaybg >/dev/null
+swaybg -o $primary -i $bg1 \
+ -o $secondary -i $bg2 &
-for workspace in 1:1 2:2 3:3 4:4; do
- swaymsg -q workspace $workspace output $primary
-done
+if [ "$XDG_CURRENT_DESKTOP" = "sway" ]; then
+ for workspace in 1:1 2:2 3:3 4:4; do
+ swaymsg -q workspace $workspace output $primary
+ done
+
+ for workspace in 5:a 6:s 7:d 8:f; do
+ swaymsg -q workspace $workspace output $secondary
+ done
+
+elif [ "$XDG_CURRENT_DESKTOP" = "niri" ]; then
+ for workspace in 1:1 2:2 3:3 4:4; do
+ niri msg action move-workspace-to-monitor --reference $workspace $primary
+ done
+
+ for workspace in 5:a 6:s 7:d 8:f; do
+ niri msg action move-workspace-to-monitor --reference $workspace $secondary
+ done
+
+ niri msg action move-workspace-to-index --reference 1:1 1
+ niri msg action move-workspace-to-index --reference 2:2 2
+ niri msg action move-workspace-to-index --reference 3:3 3
+ niri msg action move-workspace-to-index --reference 4:4 4
+
+ niri msg action move-workspace-to-index --reference 5:a 1
+ niri msg action move-workspace-to-index --reference 6:s 2
+ niri msg action move-workspace-to-index --reference 7:d 3
+ niri msg action move-workspace-to-index --reference 8:f 4
+fi
-for workspace in 5:a 6:s 7:d 8:f; do
- swaymsg -q workspace $workspace output $secondary
-done