aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2024-07-06 15:58:50 +0100
committerJustine Smithies <justine@smithies.me.uk>2024-07-06 15:58:50 +0100
commite5fc9b4b97714530b731b1d9c9bb4abc1b0ab8cb (patch)
tree9eb5c857c742a0ece26e69625eaecc8583ac8241 /.config/eww/scripts
parent56dc407c91c333ca2a866cf5fc3ff0a3fdb237d2 (diff)
Focus the lowest currently active tag if more than one monitor
Diffstat (limited to '.config/eww/scripts')
-rwxr-xr-x.config/eww/scripts/start.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/.config/eww/scripts/start.sh b/.config/eww/scripts/start.sh
index 7de1f77..3f62c55 100755
--- a/.config/eww/scripts/start.sh
+++ b/.config/eww/scripts/start.sh
@@ -16,4 +16,23 @@ for ((i = $monitors ; i >= 0 ; i-=1)); do
done
if [ "$total" -gt "1" ]; then
riverctl focus-output HDMI-A-1
+ # Focus the lowest active tag
+ num=$(river-bedload -print outputs | jq -r '.['0'] | select(.).view_tags')
+ b=0
+ while [[ $num -gt 0 ]]
+ do
+ let temp=$num%2
+ if [[ $temp -eq 1 ]]
+ then
+ let count=$count+1
+ fi
+ let num=$num/2
+ let b=b+1
+ if [[ $temp -eq 1 ]]
+ then
+ echo $b
+ riverctl set-focused-tags $((1 << ($b - 1)))
+ exit 0
+ fi
+ done
fi