hyprwm / hyprland-plugins

Official plugins for Hyprland
BSD 3-Clause "New" or "Revised" License
459 stars 42 forks source link

hyprbars: add bar_color & title_color windowrules #192

Open Misterio77 opened 1 week ago

Misterio77 commented 1 week ago

Fixes https://github.com/hyprwm/hyprland-plugins/issues/72

Adds two windowrules, for setting bg and fg color.

Some cool use cases:

https://github.com/hyprwm/hyprland-plugins/assets/5727578/180da41f-3955-4091-ab3a-579a337dabf0

``` windowrulev2=plugin:hyprbars:bar_color 0xdd1e1010, title:^\[pleione\] windowrulev2=plugin:hyprbars:title_color 0xeef8dcdc, title:^\[pleione\] windowrulev2=bordercolor 0xaaf6adfe 0xaa473535, title:^\[pleione\] windowrulev2=plugin:hyprbars:bar_color 0xdde36f6f, title:sudo windowrulev2=plugin:hyprbars:title_color 0xeeeeeeee, title:sudo windowrulev2=plugin:hyprbars:bar_color 0xdde36f6f, title:root@ windowrulev2=plugin:hyprbars:title_color 0xeeeeeeee, title:root@ windowrulev2=plugin:hyprbars:bar_color 0xee651b96, title:Gabriel Fontes windowrulev2=plugin:hyprbars:title_color 0xeeeeeeee, title:Gabriel Fontes ```

I tried my best to make it consistent with surrounding code. I've refactored nobar so that hyprbars windowrules are applied similarly to hyprland's (i.e. with a dedicated applyRule(SWindowRule) function). Please let me know if there's anything that can be improved!