dotfiles/dotlocal/bin/get_active_workspace

24 lines
510 B
Text
Raw Normal View History

2024-08-03 16:07:30 +02:00
#!/bin/sh
a=$(hyprctl workspaces | grep "workspace ID" | cut -d " " -f 3)
active=$(hyprctl monitors | grep "active workspace:" | tr -s ' ' | cut -d " " -f 3)
a=$(echo $a | tr " " "\n" | sort -g)
b="(box :space-evenly false "
for i in $a
do
if [ "${i}" == "${active}" ]
then
b="${b}(button :class 'active' :onclick 'hyprctl dispatch workspace ${i}' '${i}')"
else
b="${b}(button :class 'btw' :onclick 'hyprctl dispatch workspace ${i}' '${i}')"
fi
done
b="${b} )"
echo "$b"