waybar Configuration

Table of Contents

waybar

~/.config/waybar/config

General

"layer": "top", // Waybar at top layer
"position": "top", // Waybar position (top|bottom|left|right)
"height": 34, // Waybar height (to be removed for auto height)
"spacing": 4, // Gaps between modules (4px)
"modules-left": ["hyprland/workspaces", "pulseaudio", "network"],
"modules-center": ["hyprland/window"],
"modules-right": ["hyprland/submap", "cpu", "memory", "temperature", "battery", "tray", "clock"],

Left Modules

"modules-left": ["hyprland/workspaces", "pulseaudio", "network"],

Center Modules

"modules-center": ["hyprland/window"],

Right Modules

"modules-right": ["hyprland/submap", "cpu", "memory", "temperature", "battery", "tray", "clock"],

Modules Configuration

  • mpris
    "mpris": {
      "format": "{player_icon} {title}",
      "format-paused": "{status_icon} <i>{title}</i>",
      "player-icons": {
        "default": "▶",
        "mpv": "🎵"
      },
      "status-icons": {
        "paused": "⏸"
      },
    },
    
  • backlight
    "backlight": {
      "format": " {percent}%",
      "interval": 2,
      "on-scroll-up": "brightnessctl set +1%",
      "on-scroll-down": "brightnessctl set 1%-"
    },
    
  • hyprland/workspaces
    "hyprland/workspaces": {
        "disable-scroll": true,
        "on-click": "activate",
        "format": "{name}",
        "on-scroll-up": "hyprctl dispatch workspace m-1 > /dev/null",
        "on-scroll-down": "hyprctl dispatch workspace m+1 > /dev/null",
        "format-icons": {
            "1": "",
            "2": "",
            "3": "",
            "4": "",
            "5": "",
            "urgent": "",
            "focused": "",
            "default": ""
        }
    },
    
  • hyprland/languages
    "hyprland/language": {
      "format": "{}",
      "format-en": "en",
      "keyboard-name": "at-translated-set-2-keyboard"
    },
    
  • hyprland/window
    "hyprland/window": {
          "max-length": 50,
          "separate-outputs": true
    },
    
  • hyprland/submap
    "hyprland/submap": {
      "format": "{}",
      "max-length": 8,
      "tooltip": false
    },
    
  • keyboard-state
    "keyboard-state": {
      "numlock": false,
      "capslock": true,
      "format": "{name} {icon}",
      "format-icons": {
        "locked": "",
        "unlocked": ""
      }
    },
    
  • mpd
    "mpd": {
        "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
        "format-disconnected": "Disconnected ",
        "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
        "unknown-tag": "N/A",
        "interval": 2,
        "consume-icons": {
            "on": " "
        },
        "random-icons": {
            "off": "<span color=\"#f53c3c\"></span> ",
            "on": " "
        },
        "repeat-icons": {
            "on": " "
        },
        "single-icons": {
            "on": "1 "
        },
        "state-icons": {
            "paused": "",
            "playing": ""
        },
        "tooltip-format": "MPD (connected)",
        "tooltip-format-disconnected": "MPD (disconnected)"
    },
    
  • idle_inhibitor
    "idle_inhibitor": {
      "format": "{icon}",
      "format-icons": {
        "activated": "",
        "deactivated": ""
      }
    },
    
  • tray
    "tray": {
      "spacing": 0
    },
    
  • clock
    "clock#date": {
      // "timezone": "America/New_York",
      "format": " {:%Y/%m/%d(%a)}",
      "on-click": "alacritty --class khal -e khal interactive",
      "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
      // "format-alt": "{:%Y-%m-%d}"
    },
    "clock#time": {
      "interval": 1,
      "format": "{:%H:%M:%S}",
      "tooltip": false
    },
    
  • cpu
    "cpu": {
      "format": "{usage}% ",
      // "format": " {}%",
      "tooltip": true,
      "interval": 15
    },
    
  • memory
    "memory": {
      "interval": 30,
      "format": "{}% "
      // "max-length": 50
    },
    
  • temperature
    "temperature": {
      // "thermal-zone": 2,
      // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
      "critical-threshold": 80,
      // "format-critical": "{temperatureC}°C {icon}",
      "format": "{temperatureC}°C {icon}",
      "format-icons": ["", "", ""]
    },
    
  • battery
    "battery": {
      "states": {
        // "good": 95,
        "warning": 30,
        "critical": 15
      },
      "format": " {icon} {capacity}%",
      "format-charging": " {capacity}%",
      "format-plugged": " {capacity}%",
      "format-alt": "{icon} {time}",
      // "format-good": "", // An empty format will hide the module
      // "format-full": "",
      "format-icons": ["", "", "", "", ""]
    },
    "battery#bat2": {
      "bat": "BAT2"
    },
    
  • network
    "network": {
      // "interface": "wlp2*", // (Optional) To force the use of this interface
      "format": "{ifname}",
      "format-wifi": "{essid} ({signalStrength}%) ",
      "format-ethernet": "{ipaddr}/{cidr} ",
      "tooltip-format": "{ifname} via {gwaddr} ",
      "format-linked": "{ifname} (No IP) ",
      "format-disconnected": "Disconnected ⚠",
      "format-alt": "{ifname}: {ipaddr}/{cidr} ({bandwidthUpBits} - {bandwidthDownBits})"
    },
    
  • wireplumber
    "wireplumber": {
      "format": "{icon} {volume}%",
      "format-icons": ["󰕿", "󰖀", "󰕾"],
      "format-muted": "",
      "on-click": "helvum",
      "on-click-right": "pwvucontrol",
      "scroll-step": 0.2
    },
    
  • pulseaudio
    "pulseaudio": {
      // "scroll-step": 1, // %, can be a float
      "format": "{volume}% {icon} {format_source}",
      "format-bluetooth": "{volume}% {icon} {format_source}",
      "format-bluetooth-muted": " {icon} {format_source}",
      "format-muted": " {format_source}",
      "format-source": "{volume}% ",
      "format-source-muted": "",
      "format-icons": {
        "headphone": "",
        "hands-free": "",
        "headset": "",
        "phone": "",
        "portable": "",
        "car": "",
        "default": ["", "", ""]
      },
      "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
    },
    
  • custom/pacman
    "custom/pacman": {
      "format": " {} update available",
      "exec": "checkupdates | wc -l",
      "exec-if": "test $(checkupdates | wc -l) -ne 0",
      "interval": 3600,
      "on-click": "checkupdates; pkill -SIGRTMIN+8 waybar"
    },
    
  • custom/launcher
    "custom/launcher":{
      "format": " ",
      "tooltip": false,
      "on-click": "rofi -show drun -theme hyprland-menu",
      "on-click-right": "killall rofi"
    },
    
  • custom/power
    "custom/power":{
      "format": " ",
      "tooltip": false,
      "on-click": "~/.local/bin/rofi-logout hyprland-logout"
    },
    
  • custom/media
    "custom/media": {
      "format": "{icon} {}",
      "return-type": "json",
      "max-length": 40,
      "format-icons": {
        "spotify": "",
        "default": "🎜"
      },
      "escape": true,
      "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
      // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
    }
    

~/.config/waybar/style.css

definitions

@define-color color00 #2e3440;
@define-color color01 #3b4252;
@define-color color02 #434c5e;
@define-color color03 #4c566a;
@define-color color04 #d8dee9;
@define-color color05 #e5e9f0;
@define-color color06 #eceff4;
@define-color color07 #8fbcbb;
@define-color color08 #88c0d0;
@define-color color09 #81a1c1;
@define-color color10 #5e81ac;
@define-color color11 #bf616a;
@define-color color12 #d08770;
@define-color color13 #ebcb8b;
@define-color color14 #a3be8c;
@define-color color15 #ba8baf;

global

* {
      transition: none;
      box-shadow: none;
}

waybar

#waybar {
      font-family: 'JetBrainsMonoNL Nerd Font Mono', sans-serif;
      font-size: 1.2em;
      font-weight: 400;
      color: @color06;
      background: @color01;
}

window

#window {
      font-size: 0.9em;
      font-weight: 400;
      font-family: sans-serif;
}

workspaces

#workspaces {
      margin: 0 4px;
}

#workspaces button {
      margin: 4px 0;
      padding: 0 4px;
      color: @color03;
}

#workspaces button.visible {
}

#workspaces button.active {
      border-radius: 4px;
      color: @color06;
      background-color: @color02;
}

#workspaces button.urgent {
      color: rgba(238, 46, 36, 1);
}

mode

#mode, #battery, #cpu, #memory, #network, #pulseaudio, #idle_inhibitor, #backlight, #custom-storage, #custom-updates, #custom-weather, #custom-mail, #clock, #temperature, #language{
      margin: 4px 2px;
      padding: 0 6px;
      background-color: @color02;
      border-radius: 4px;
      min-width: 20px;
}

pulseaudio

#pulseaudio.muted {
      color: @base0F;
}

#pulseaudio.bluetooth {
      color: @color13;
}

clock

#clock {
      margin-left: 0px;
      margin-right: 4px;
      background-color: transparent;
}

temperature

#temperature.critical {
      color: @color13;
}

language

#language {
      font-size: 0.9em;
      font-weight: 500;
      letter-spacing: -1px;
}

tray

#tray {
      margin: 4px 4px 4px 4px;
      border-radius: 4px;
      background-color: @color02;
}

#tray * {
      padding: 0 6px;
      border-left: 1px solid @color00;
}

#tray *:first-child {
      border-left: none;
}

Date: 2025-09-17 Wed 00:00

Author: Kristian Alexander P

Created: 2025-09-17 Wed 15:25