-
Notifications
You must be signed in to change notification settings - Fork 304
Description
Problem Description
Currently, Polybar’s accent color, individual module colors (such as bspwm, launcher, bluetooth, etc.), and bar transparency cannot be configured directly through RiceEditor.
This results in visual inconsistencies when switching theme colors and limits the user’s ability to customize Polybar from a single, centralized interface.
Implemented Solution (Prototype for the yael Theme)
A working prototype was implemented in the yael theme, demonstrating the feasibility of centralized control through RiceEditor.
1. Centralization of the Accent Color (blue)
In theme-config.bash:
blue_default="#33b1ff" # Original default theme color
blue="#33b1ff" # Value modified by RiceEditor
export blueIn Polybar (config.ini / modules.ini):
[color]
blue = ${env:blue:#33b1ff}All relevant Polybar modules now rely on ${env:blue} or ${color.blue}, including:
bspwmlauncherbluetoothpulseaudionetworkcpu_barmemory_barmpd_controlmplayerusercardpowerupdatesxkeyboardtray
In Bar.bash:
export blue2. Restored Workspace Distinction in bspwm
In modules.ini ([module/bspwm]):
label-focused-background = ${color.blue} ; Focused workspace
label-occupied-foreground = ${color.indigo} ; Occupied workspace
label-empty-foreground = ${color.grey} ; Empty workspace
label-urgent-foreground = ${color.blue} ; Urgent workspaceThis maintains clear workspace differentiation while staying consistent with the theme's accent color.
3. Integration into RiceEditor
- A color picker was added (in the “Bspwm” tab) to modify the
bluevariable intheme-config.bash. - A Reset button was added, restoring the accent color using
blue_default.
4. Polybar Transparency Control
In theme-config.bash:
bar_alpha="DD" # Hex value from 00 (transparent) to FF (opaque)In Bar.bash:
bg_color_no_hash="${bg:1}" # Removes leading '#'
export bar_final_bg="#${bar_alpha}${bg_color_no_hash}"In Polybar (config.ini):
background = ${env:bar_final_bg}In RiceEditor:
- A slider was added to adjust
bar_alphain real time.
Benefits
- Full centralized control of Polybar’s accent color.
- Adjustable transparency directly from RiceEditor.
- Consistent color usage across all Polybar modules.
- Clear visual distinction in
bspwmworkspaces. - Cleaner, theme-wide aesthetic cohesion.
Suggestion for Generalization
To maximize consistency across all themes, it is recommended to:
- Standardize key variables (
blue,blue_default,bar_alpha, etc.). - Ensure
Theme.shexports these variables universally. - Update Polybar configuration for every theme to rely on the same environment-driven color structure.
This would enable global, uniform customization through RiceEditor across the entire theme repository.