Skip to content

Displaying just the current space number? #289

Answered by FelixKratz
neutonfoo asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, thats actually rather simple. You can use a regular item and subscribe it to the space change event:
You would need an item per display, this demo shows how it is done for the primary display:

sketchybar --add item space right \
           --set space script="$PLUGIN_DIR/current_space.sh" \
           --subscribe space space_change

current_space.sh:

#!/bin/sh

SPACE_ID=$(echo "$INFO" | jq -r '."display-1"')

sketchybar --set $NAME label=$SPACE_ID

You could go from here and choose to display the item only on the relevant display by assigning an associated_display.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@neutonfoo
Comment options

Answer selected by neutonfoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants