Closed i-ilak closed 11 months ago
Instead of setting the width to zero, you could set the drawing
property to off
. This completely disables those items and they will no longer contribute to the width of the bracket. Currently toggling the drawing
property can not be animated however.
This snippet does exactly what you want (without animations):
sketchybar --add item c.control right \
--set c.control icon="<>" label=Toggle \
click_script="sketchybar --set '/c\.[0-9]/' drawing=toggle" \
--add item c.1 right --set c.1 icon=1 label=one \
--add item c.2 right --set c.2 icon=2 label=two \
--add item c.3 right --set c.3 icon=3 label=three
sketchybar --add bracket collection '/c\..*/' \
--set collection background.height=25 background.color=0xffff0000
The best way to animate this would probably be to add an animation handler for the drawing
property in the source code of sketchybar. Other boolean properties have include such an animation already so it could be a worthwhile improvement.
You could of course hack the animation in anyways by using key-frame animation steps where you chain together multiple animations but I think this gets out of hand quickly.
Im currently working on a group of items (enclosed by brackets, gif below) and Im struggling to get the intended behaviour. The goal is to have a single icon visible by default and then once clicked on that item for the brackets to expand to show some other items.
My current approach
assume we have an item, lets call it "system_icon" and we only assign it an icon and make sure that it executes the function
toggle_detail
when clicked on it. The corresponding plugin script would look something like thisQuestions
system_info
icon when it gets contracted?