aboutsummaryrefslogtreecommitdiff
path: root/kanshi
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2023-10-06 13:03:50 +0200
committerbozo.kopic <bozo@kopic.xyz>2023-10-06 13:03:50 +0200
commit872615941ef71eefc86c3e637959a2ede7f33c20 (patch)
tree9fb507ca0d45ba976163f97b35e7a4f3b3c7a0de /kanshi
parent9b7d09d161e3000c8c440059040348466b16811c (diff)
.
Diffstat (limited to 'kanshi')
-rw-r--r--kanshi/config7
-rwxr-xr-xkanshi/home_tv.sh33
2 files changed, 40 insertions, 0 deletions
diff --git a/kanshi/config b/kanshi/config
index 8558082..9750a16 100644
--- a/kanshi/config
+++ b/kanshi/config
@@ -16,3 +16,10 @@ profile work {
output 'Dell Inc. DELL U2722D 3ZS8XN3' # DP-6
exec ~/.config/kanshi/work.sh
}
+
+profile home_tv {
+ output eDP-1
+ output 'AOC Q2770 FSUE7HA007776' # DP-6
+ output 'LG Electronics LG TV 0x00000101' # DP-5
+ exec ~/.config/kanshi/home_tv.sh
+}
diff --git a/kanshi/home_tv.sh b/kanshi/home_tv.sh
new file mode 100755
index 0000000..5cb1392
--- /dev/null
+++ b/kanshi/home_tv.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+display1=eDP-1
+display3=$(swaymsg -t get_outputs -r |
+ jq -r '.[] | select(.model == "LG TV") | .name')
+display2=$(swaymsg -t get_outputs -r |
+ jq -r ".[] | .name | select(. != \"$display1\" and . != \"$display3\")")
+
+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
+
+display2_width=$(swaymsg -t get_outputs -r |
+ jq -r ".[] | select(.name == \"$display2\") | .current_mode.width")
+
+swaymsg -q output $display3 pos $((1920 + $display2_width)) 0 \
+ bg ~/.pictures/bg1.jpg stretch
+
+for workspace in 1:1 3:3 4:4; do
+ swaymsg -q workspace $workspace output $display1
+done
+
+for workspace in 5:a 6:s 7:d 8:f; do
+ swaymsg -q workspace $workspace output $display2
+done
+
+for workspace in 2:2; do
+ swaymsg -q workspace $workspace output $display3
+done