Setting up Waybar
Demystifying Waybar styling and layout configuration on CachyOS, featuring modular styles and CSS color injection.
The Customization Paradox
You finally booted into CachyOS. Magnificent, right? But then you look up, and the default status bar looks completely out of place, or worse — nonexistent.
Configuring your desktop status bar is arguably the easiest first step into ricing Linux. So let’s get to it.
OK, I lied. Maybe you should start with configuring your Hyprland configurations - but that shifted to Lua recently and I have not gotten to migrating mine yet.
Below are some of the tools I used, but the text editor can really be anything you want. I may have used Visual Studio Code here and there - but as long as you can edit text, you’re fine.
Ingredients
| Requirement | Details | Reference |
|---|---|---|
| Waybar | Highly customizable Wayland status bar | https://github.com/Alexays/Waybar |
| Nerd Fonts | System icons (Symbols Nerd Font preferred) | https://www.nerdfonts.com/ |
| CachyOS / Arch | An active Wayland composited desktop environment | https://cachyos.org/ |
| Text Editor | For dealing with JSONC and CSS quirks | https://www.nano-editor.org/ |
You can find my rice here: https://github.com/vnsnippets/arch-basmati-rice.
The Blueprint (config.jsonc)
Waybar relies on a master JSONC (JSON with Comments) structure. Think of this as defining the overall layout of your status bar and what it will hold.
Our setup splits the top bar into three functional target zones: Left (Time), Center (Workspaces), and Right (System States & Hardware toggles).
| |
There is a whole world of modules supported listed in the official wiki at https://github.com/alexays/waybar/wiki.
Modules: Clock
Complete wiki at https://github.com/Alexays/Waybar/wiki/module:-clock.
| |
I don’t need much from my clock, so moving on.
Modules: Workspaces
Complete wiki at https://github.com/Alexays/Waybar/wiki/Module:-Hyprland#workspaces.
| |
Now, I don’t know what fonts you have installed and if this will show correctly on your screen - but for the format, I am using a big filled circle from (any) Nerd Fonts.
This gives it a “dot” appearance, but the colors will tell me which workspace is active or not.
Setting
"all-outputs": falseensures your workspaces don’t leak across secondary displays. If you multi-task heavily on twin monitors, leaving this true will cause visual confusion as workspace IDs start stepping on each other’s toes.
Next we will dive into the modules, followed then by the styles which brings in the nice colors and aesthetics.
Modules: Network
Complete wiki at https://github.com/Alexays/Waybar/wiki/Module:-Network.
| |
Notice how we leverage Pango markup syntax directly inside the JSON structure to inject explicit font sizes and hex codes directly to the icons.
Modules: Pulse Audio
Complete wiki at https://github.com/Alexays/Waybar/wiki/Module:-PulseAudio.
| |
Setting format determines the structure of what will show on the status bar component, and the specific formats like format-muted or format-icons determines the actual content.
In particular, format-icons.default takes an array to adapt the icon based on your volume level.
Battery
| |
The formatting here is similar to Pulse Audio, but battery also takes a states.warning and states.critical setting to allow style changes based on whether your battery is below those levels.
Modules: Power Profiles
Complete wiki at https://github.com/Alexays/Waybar/wiki/Module:-PowerProfilesDaemon.
| |
This module allows changing the battery power mode, and the icon can be set differently for each mode as well.
Modules: Custom (Power)
Complete wiki at https://github.com/Alexays/Waybar/wiki/Module:-Custom.
| |
This is a bit of a special one.
You can create custom components that invokes scripts. In my case, I added a shut-down button that simply runs the poweroff command when clicked.
Styles
If you dump all your styling logic and hex color codes into a massive, monolithic file, modifying your theme later will feel like walking through mud. Instead, we can implement modular stylesheet grouping.
We’ll abstract colors out completely into a palette declaration module called colors.css, and import it into our layout style definitions.
Defining the Core Palette (colors.css)
| |
Assembling the style (style.css)
| |
This is simply CSS - which means you can add :hover and other CSS selectors to further customize everything.
Similarly, by binding attributes onto generic CSS variable placeholders (@module-background and @module-border), changing the theme across the whole status bar down the road requires nothing more than editing color palette in colors.css.
Custom Layout Options: Chaining vs Islands
When building bars, ricing enthusiasts often argue over structural layout schemes. Let’s do a quick comparison of the two dominant structural behaviors:
| Layout Style | The Good | The Bad |
|---|---|---|
| Monolithic Unified Block | Clean traditional look, zero gap calculation issues, easy alignment. | Harder to accent specific metric warnings visually. |
| Pill / Island Configuration | Exceptional modularity, beautiful modern gaps, distinct element groups. | Margin configurations can get tedious quickly. |
Our configuration leverages a clean standalone island configuration where each distinct functional module gets isolated padding rules, structural border treatments, and specific border radius to create a floating pill aesthetic over a transparent compositor layer.
Complete Style
Here is my full stylesheet with all the hovers and specific colors.
| |
And that’s it ✌️
You now have a modularized status bar configuration that will survive whatever system alterations you cook up next.
Full disclosure: I stopped using Waybar a week into my journey and went for coding my own desktop aesthetics from scratch.
Till the next one, stay techy :)