aboutsummaryrefslogtreecommitdiff
path: root/kanshi/dual.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kanshi/dual.sh')
-rwxr-xr-xkanshi/dual.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/kanshi/dual.sh b/kanshi/dual.sh
index 3e9ee3e..b9c08cf 100755
--- a/kanshi/dual.sh
+++ b/kanshi/dual.sh
@@ -1,22 +1,21 @@
#!/bin/sh
-display1=eDP-1
-display2=$(swaymsg -t get_outputs -r |
- jq "map(select(.name != \"$display1\") | .name)[0]" 2> /dev/null |
- tr -d "\"")
+. $(dirname "$(realpath "$0")")/env.sh
+
+secondary=$(display_names ".name != \"$primary\"")
swaymsg -q reload
-swaymsg -q output $display1 pos 0 0 \
- res 1920x1080 \
- bg ~/.pictures/bg1.jpg stretch
-swaymsg -q output $display2 pos 1920 0 \
- bg ~/.pictures/bg2.jpg stretch
+swaymsg -q output $primary pos 0 0 \
+ res $primary_res \
+ bg $bg1 stretch
+swaymsg -q output $secondary pos $primary_width 0 \
+ bg $bg2 stretch
for workspace in 1:1 2:2 3:3 4:4; do
- swaymsg -q workspace $workspace output $display1
+ swaymsg -q workspace $workspace output $primary
done
for workspace in 5:a 6:s 7:d 8:f; do
- swaymsg -q workspace $workspace output $display2
+ swaymsg -q workspace $workspace output $secondary
done