faster aerospace + sketchybar

main
Alpha Chen 1 month ago
parent 5836064024
commit ca3a098999
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -3,9 +3,7 @@
# Original source: # Original source:
# https://nikitabobko.github.io/AeroSpace/goodness#show-aerospace-workspaces-in-sketchybar # https://nikitabobko.github.io/AeroSpace/goodness#show-aerospace-workspaces-in-sketchybar
workspaces=("${(@f)$(aerospace list-workspaces --monitor $1)}") if (($argv[(Ie)$FOCUSED_WORKSPACE])); then
if (($workspaces[(Ie)$FOCUSED_WORKSPACE])); then
sketchybar --set "$NAME" label="$FOCUSED_WORKSPACE" background.drawing=on sketchybar --set "$NAME" label="$FOCUSED_WORKSPACE" background.drawing=on
else else
sketchybar --set "$NAME" label="$FOCUSED_WORKSPACE" background.drawing=off sketchybar --set "$NAME" label="$FOCUSED_WORKSPACE" background.drawing=off

@ -39,13 +39,15 @@ sketchybar --default "${default[@]}"
sketchybar --add event aerospace_workspace_change sketchybar --add event aerospace_workspace_change
for monitor in $(aerospace list-monitors | awk '{print $1}'); do for monitor in $(aerospace list-monitors | awk '{print $1}'); do
# pass in workspaces since it takes a noticeable amount of time to run
workspaces=("${(@f)$(aerospace list-workspaces --monitor "$monitor")}")
sketchybar --add item aerospace.$monitor left \ sketchybar --add item aerospace.$monitor left \
--subscribe aerospace.$monitor aerospace_workspace_change \ --subscribe aerospace.$monitor aerospace_workspace_change \
--set aerospace.$monitor \ --set aerospace.$monitor \
display=$monitor \ display=$monitor \
icon.drawing=off \ icon.drawing=off \
label="$(aerospace list-workspaces --focused)" \ label="$(aerospace list-workspaces --focused)" \
script="$CONFIG_DIR/plugins/aerospace.sh $monitor" script="$CONFIG_DIR/plugins/aerospace.sh $workspaces"
done done
##### Adding Left Items ##### ##### Adding Left Items #####

Loading…
Cancel
Save