aboutsummaryrefslogtreecommitdiff
path: root/.config/cow
diff options
context:
space:
mode:
Diffstat (limited to '.config/cow')
-rwxr-xr-x.config/cow/after-start.sh23
1 files changed, 18 insertions, 5 deletions
diff --git a/.config/cow/after-start.sh b/.config/cow/after-start.sh
index 8fc38ff..81167a2 100755
--- a/.config/cow/after-start.sh
+++ b/.config/cow/after-start.sh
@@ -35,10 +35,23 @@ mixer vol.mute="$(grep 'vol.mute=' ~/.cache/audio-volume | awk -F '=' '{print $2
pkill -9 swayidle
sh "$HOME/.config/waybar/scripts/swayidle-update.sh"
-# Start cowpager
+# kill any running instances if they exist
pkill -9 cowpager
-cowpager &
-
-# Start cowbuttons
pkill -9 cowbuttons
-cowbuttons &
+
+# start cowpager and cowbuttons for each monitor
+monitors=$(moocow show output | jq -r '.data[] | .name' | wc -l | xargs)
+
+i=$monitors
+while [ "$i" -ge 1 ]; do
+ output=$(moocow show output | jq -r '.data[] | .name' | awk 'FNR == '$i' {print}')
+ moocow focus -o "$output"
+ # Slow script down as it causes problems with the positioning rules in cow.conf
+ sleep 0.1
+ cowpager -m "$output" &
+ cowbuttons &
+ # Focus the lowest active tag (desk nr)
+ num=$(moocow show desk | jq -r '.data.desks | map(select(.active == true)) | sort_by(.nr) | .[0].nr')
+ moocow desk -t "$output" -d "$num"
+ i=$((i-1))
+done