Skip to content

Limit amount of characters #251

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

You must be logged in to vote

When you get the title of the window from yabai you can simply cut it with e.g. sed:

TITLE=$(yabai -m query --windows --window | jq -r '.title' | sed 's/\(.\{30\}\).*/\1.../'
sketchybar --set $NAME label="$TITLE"

This example cuts the title after 30 characters and adds "..." to the end if the string was truncated, titles under 30 characters do not get changed.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by itaysharir
Comment options

You must be logged in to vote
0 replies
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