SketchyBar event scripts
How a sketchybar item stays current: its script runs on a timer, on a subscribed event, or both, and updates only that item.
update_freq=Nruns the script every N seconds (calendar 30, CPU 2, battery 120 in josean-martinez's setup).- Subscribing with
--subscribe <item> <event>makes it run on events such asvolume_change,power_source_change,system_woke,front_app_switched,space_windows_changeandmedia_change. - Inside the script,
$NAMEis the calling item,$SENDERthe event, and$INFOthe event's data, sometimes JSON that jq parses. Space items also get$SELECTED. - Josean keeps item definitions in
items/(sourced fromsketchybarrc) and the scripts inplugins/.$PLUGIN_DIRisn't visible inside plugin scripts, so they use$CONFIG_DIR/plugins.
Source: report