aboutsummaryrefslogtreecommitdiff
path: root/kanshi/dual.sh
diff options
context:
space:
mode:
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