Interactively change color theme of bar #159
-
I would like to change the color scheme of my SketchyBar depending on the current system dark/light mode. Currently I see three approaches in doing so:
I already have a global variable that resembles system dark/light mode so the last option seams to be the most straight-forward and maintainable. But maybe there is an option I'm not considering that maybe let's me avoid restarting SketchyBar? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The most elegant solution to this would probably be to use the regex feature of SketchyBar. I implemented it for precisely such tasks: sketchybar --set '/.*/' icon.color=0xff000000 sets the icon color of all items matching the regex Also, you can subscribe to the sketchybar --add event theme_change AppleInterfaceThemeChangedNotification and sketchybar --subscribe <item that holds the theme change script> theme_change |
Beta Was this translation helpful? Give feedback.
The most elegant solution to this would probably be to use the regex feature of SketchyBar. I implemented it for precisely such tasks:
The item
<name>
can be a regular expression inside of two '/':/<regex>/
.E.g.:
sketchybar --set '/.*/' icon.color=0xff000000
sets the icon color of all items matching the regex
.*
(so all items) to black. This works for any regex and all the other properties of course work as well. This way you can also set properties for any named groups if you employ the appropriate naming convention in your configuration file.Also, you can subscribe to the
AppleInterfaceThemeChangedNotification
via a custom event that gets triggered instantaneously when the system the…