Skip to content
NullString1 edited this page Jan 13, 2026 · 1 revision

Waybar Configuration

Waybar is the status bar used in NullOS, providing system information, workspace indicators, and quick controls.

Overview

Configuration File:home/waybar/default.nix
Module Location:home/waybar/
Style: Automatically themed by Stylix

Waybar displays:

  • Workspace indicators
  • Window title
  • System tray
  • Clock and calendar
  • CPU/Memory/Temperature
  • Network status
  • Audio volume
  • Battery status (laptops)

Configuration Structure

Waybar configuration in NullOS uses Nix to define the JSON config and CSS styling.

# home/waybar/default.nix{programs.waybar={enable=true;settings={mainBar={# Configuration here};};style='' /* CSS styling here */ '';};}

Module Configuration

Position and Layout

mainBar={layer="top";position="top";height=30;spacing=4;modules-left=["hyprland/workspaces""hyprland/window"];modules-center=["clock"];modules-right=["tray""cpu""memory""pulseaudio""network""battery"];};

Workspaces Module

"hyprland/workspaces"={format="{icon}";format-icons={"1"="一";"2"="二";"3"="三";"4"="四";"5"="五";default="";};persistent-workspaces={"*"=5;};};

Clock Module

clock={format="{:%H:%M}";format-alt="{:%A, %B %d, %Y (%H:%M)}";tooltip-format="<tt><small>{calendar}</small></tt>";calendar={mode="month";mode-mon-col=3;weeks-pos="right";on-scroll=1;format={months="<span color='#ffead3'><b>{}</b></span>";days="<span color='#ecc6d9'><b>{}</b></span>";weeks="<span color='#99ffdd'><b>W{}</b></span>";weekdays="<span color='#ffcc66'><b>{}</b></span>";today="<span color='#ff6699'><b><u>{}</u></b></span>";};};};

CPU Module

cpu={format=" {usage}%";tooltip=true;interval=2;on-click="ghostty -e btop";};

Memory Module

memory={format=" {}%";tooltip-format="RAM: {used:0.1f}G / {total:0.1f}G\nSwap: {swapUsed:0.1f}G / {swapTotal:0.1f}G";interval=5;on-click="ghostty -e btop";};

Network Module

network={format-wifi=" {signalStrength}%";format-ethernet="";format-disconnected="󰤭";tooltip-format="{ifname}: {ipaddr}/{cidr}";tooltip-format-wifi="{essid} ({signalStrength}%)\n{ipaddr}";on-click="nm-connection-editor";};

Audio Module

pulseaudio={format="{icon} {volume}%";format-muted="󰝟";format-icons={headphone="";hands-free="";headset="";phone="";portable="";car="";default=[""""""];};on-click="pavucontrol";scroll-step=5;};

Battery Module

battery={states={warning=30;critical=15;};format="{icon} {capacity}%";format-charging=" {capacity}%";format-plugged=" {capacity}%";format-icons=[""""""""""];tooltip-format="{timeTo}, {capacity}%\nPower: {power}W";};

System Tray

tray={icon-size=16;spacing=8;};

Styling

Basic CSS Structure

* {
border: none;
border-radius:0;
font-family:"JetBrainsMono Nerd Font";
font-size:13px;
min-height:0;
}
window#waybar {
background:rgba(30,30,46,0.9);
color:#cdd6f4;
}
#workspaces {
margin:05px;
}
#workspacesbutton {
padding:010px;
background: transparent;
color:#cdd6f4;
border-bottom:2px solid transparent;
}
#workspacesbutton.active {
color:#89b4fa;
border-bottom:2px solid #89b4fa;
}
#workspacesbutton:hover {
background:rgba(137,180,250,0.2);
}
#clock,#cpu,#memory,#network,#pulseaudio,#battery,#tray {
padding:010px;
margin:02px;
}
#battery.charging {
color:#a6e3a1;
}
#battery.warning:not(.charging) {
color:#f9e2af;
}
#battery.critical:not(.charging) {
color:#f38ba8;
animation: blink 1s linear infinite;
}
@keyframes blink {
to {
color:#cdd6f4;
}
}

Using Stylix Colors

Waybar can use Stylix color variables:

window#waybar {
background:@base00;
color:@base05;
}
#workspacesbutton.active {
color:@base0D;
border-bottom:2px solid @base0D;
}

Custom Modules

Weather Module

"custom/weather"={format="{}°";tooltip=true;interval=3600;exec="wttrbar";return-type="json";};

Media Player Module

"custom/media"={format="{icon} {}";format-icons={Playing="";Paused="";};max-length=40;exec="playerctl metadata --format '{{ artist }} - {{ title }}'";on-click="playerctl play-pause";interval=2;};

Power Menu

"custom/power"={format="";on-click="wlogout";tooltip=false;};

Updates Available

"custom/updates"={format=" {}";interval=3600;exec="checkupdates | wc -l";exec-if="exit 0";on-click="ghostty -e sudo nixos-rebuild switch --flake .";signal=8;};

Multiple Bars

Create multiple Waybar instances:

programs.waybar={enable=true;settings={mainBar={output="eDP-1";# Primary monitor config};secondaryBar={output="HDMI-A-1";# Secondary monitor config};};};

Tips & Tricks

Reload Waybar

killall waybar
waybar &

Or add keybinding in Hyprland:

bind=SUPERSHIFT,R,exec,killallwaybar&&waybar &

Debug Waybar

Run in terminal to see errors:

waybar --log-level debug

Custom Icons

Use Nerd Font icons: https://www.nerdfonts.com/cheat-sheet

format=" {capacity}%";# Batteryformat=" {usage}%";# CPUformat=" {}%";# Memory

Common Customizations

Transparent Background

window#waybar {
background: transparent;
}
#workspaces,#clock,#cpu,#memory {
background:rgba(30,30,46,0.8);
border-radius:10px;
margin:5px;
padding:015px;
}

Floating Modules

#workspaces,#clock,#tray {
background:@base00;
border-radius:15px;
margin:5px5px5px0;
padding:015px;
}

Bottom Bar

mainBar={position="bottom";};

Troubleshooting

Waybar Not Showing

Check if running:

pgrep waybar

Start manually:

waybar

Icons Not Displaying

Ensure Nerd Fonts are installed:

home.packages=[pkgs.nerd-fonts];

Module Not Updating

Increase interval or check exec command:

# Test command manually
playerctl metadata

Next Steps

Clone this wiki locally