aerospace + sketchybar

main
Alpha Chen 1 week ago
parent 00966df049
commit 87344b7cd2
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -1,5 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env zsh
if [ -n "$FOCUSED_WORKSPACE" ]; then # Original source:
sketchybar --set "$NAME" label="$FOCUSED_WORKSPACE" # https://nikitabobko.github.io/AeroSpace/goodness#show-aerospace-workspaces-in-sketchybar
workspaces=("${(@f)$(aerospace list-workspaces --monitor $1)}")
if (($workspaces[(Ie)$FOCUSED_WORKSPACE])); then
sketchybar --set "$NAME" label="$FOCUSED_WORKSPACE" background.drawing=on
else
sketchybar --set "$NAME" label="$FOCUSED_WORKSPACE" background.drawing=off
fi fi

@ -38,12 +38,15 @@ sketchybar --default "${default[@]}"
### Aerospace ### Aerospace
sketchybar --add event aerospace_workspace_change sketchybar --add event aerospace_workspace_change
sketchybar --add item aerospace left \ for monitor in $(aerospace list-monitors | awk '{print $1}'); do
--subscribe aerospace aerospace_workspace_change \ sketchybar --add item aerospace.$monitor left \
--set aerospace \ --subscribe aerospace.$monitor aerospace_workspace_change \
icon.drawing=off \ --set aerospace.$monitor \
label="$(aerospace list-workspaces --focused)" \ display=$monitor \
script="$CONFIG_DIR/plugins/aerospace.sh" icon.drawing=off \
label="$(aerospace list-workspaces --focused)" \
script="$CONFIG_DIR/plugins/aerospace.sh $monitor"
done
##### Adding Left Items ##### ##### Adding Left Items #####
# We add some regular items to the left side of the bar, where # We add some regular items to the left side of the bar, where

Loading…
Cancel
Save