Waybar
Mechanism
Section titled “Mechanism”Waybar is styled via style.css. It supports live reloading if the config changes, OR via
SIGUSR2. However, often we only want to change specific colors, not the whole CSS layout.
2. Themis’s Approach
Section titled “2. Themis’s Approach”We use Template + Include + Signal.
- Generate
~/.config/waybar/colors.css. - Import this in
style.css. - Send
SIGUSR2to reload the bar without restarting the process.
3. User Setup
Section titled “3. User Setup”One-time: Add import to ~/.config/waybar/style.css:
@import "colors.css";
/* Use the variables defined in colors.css */window#waybar { background-color: @base; color: @text;}4. Equivalent Configuration
Section titled “4. Equivalent Configuration”enroll: waybar: type: template input: "~/.config/themis/templates/waybar_colors.css.j2" output: "~/.config/waybar/colors.css" # The crucial reload step reload_signal: SIGUSR2 # OR manual command: # reload_cmd: "pkill -SIGUSR2 waybar"