From ff2e7577925ac6c920373e91b5a562716ccfb2fb Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Sun, 16 Aug 2026 16:45:47 +0100 Subject: Added a script at the end of afterstart,sh to open a seperate cowpager and cowbuttons on each monitor. --- .config/cow/after-start.sh | 23 ++++++++++++++++++----- 1 file 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 -- cgit v1.3