SketchyBar icon indicating copy to clipboard operation
SketchyBar copied to clipboard

Background aware font setup

Open rytswd opened this issue 2 months ago • 4 comments

Sorry if this is something sketchybar is already capable handling, I just couldn't find any mention in the documentation... 🙇

Currently, I got most of my config setup with custom look and feel -- but for some inputs like bluetooth, audio and keyboard, I'm currently using the macOS alias instead. This is what it looks right now. image

As you can see, the widgets from macOS have the font colour based on the wallpaper, and it renders icons in white in this case. As my wallpaper setup uses shuffled landscape, I want to be able to do a similar background-aware font colour setup. Is this supported, and if so, how would I go about that?

rytswd avatar Apr 29 '24 11:04 rytswd

I invested some time in the past to make this possible by replacing the coloring of the aliases, basically aliases have the property alias.color=<argb_hex> available to override the color.

Implementation: https://github.com/FelixKratz/SketchyBar/blob/4194da0bd277b9b2fd2535eb963a7fd6468a0464/src/alias.c#L242-L253 Documentation: https://felixkratz.github.io/SketchyBar/config/components#item-alias----mirror-items-of-the-original-macos-status-bar-into-sketchybar

FelixKratz avatar Apr 29 '24 12:04 FelixKratz

Thanks for the details, and sorry I should have clarified better -- I actually prefer the macOS colouring to be aware of the wallpaper colour, and was curious if sketchybar can have the changing colour behaviour for non-alias widgets as well.

So in the above screenshot, I want the calendar and other widgets to show up in white, if the wallpaper is rather dark. I imagine supporting something like this would be a lot of undertaking, but wanted to check if it's already implemented.

rytswd avatar Apr 29 '24 21:04 rytswd

I think you should be able to script this, see this comment: https://github.com/FelixKratz/SketchyBar/discussions/159#discussioncomment-1986310

FelixKratz avatar Apr 30 '24 05:04 FelixKratz

Ah thank you, the regex support is something I didn't come across, I'll check more on that. The macOS behaviour I'm referring to is based on the wallpaper brightness, though -- so I'm not sure if this is something I can subscribe to. I'll do a bit more digging in the coming days and report if I can make it work as I like

rytswd avatar Apr 30 '24 21:04 rytswd