AgentSkillsCN

configuring-waybar

当您需要配置 Waybar 状态栏、编写 waybar 配置文件或样式文件、添加模块、使用 CSS 进行样式调整,或排查 Waybar 相关问题时,此技能也能为您提供全面的参考文档指引。

SKILL.md
--- frontmatter
name: configuring-waybar
description: Use when configuring Waybar status bar, writing waybar config or style files, adding modules, styling with CSS, or troubleshooting Waybar issues - navigates comprehensive reference documentation

Configuring Waybar

Waybar is a highly customizable Wayland bar for Sway and other wlroots-based compositors. This skill navigates the complete Waybar documentation to answer configuration questions.

Config location: ~/.config/waybar/config.jsonc (JSON with comments) and ~/.config/waybar/style.css

Commands: waybar (start) | killall waybar && waybar & (restart) | waybar --help

How to Use This Skill

  1. Identify user intent from the topic index below
  2. Read the relevant doc file(s) from the docs/ subdirectory (paths are relative to this skill's directory)
  3. Answer using the documentation content

Always read docs before answering - don't rely on general knowledge about Waybar.

Topic Index

Core Documentation

User asks about...Read this file
Installation, getting starteddocs/Installation.md
Main config structure, bar settingsdocs/Configuration.md
CSS styling, themes, customizationdocs/Styling.md
Common problems, troubleshootingdocs/FAQ.md
All available modules overviewdocs/Modules.md
Example configurationsdocs/Examples.md
Available themesdocs/Themes.md

System Monitoring Modules

User asks about...Read this fileModule name
CPU usage, loaddocs/Module:-CPU.mdcpu
RAM, memory usagedocs/Module:-Memory.mdmemory
Disk usage, mountsdocs/Module:-Disk.mddisk
System load averagesdocs/Module:-Load.mdload
Temperature sensorsdocs/Module:-Temperature.mdtemperature
Battery statusdocs/Module:-Battery.mdbattery
Battery via UPowerdocs/Module:-UPower.mdupower
Failed systemd unitsdocs/Module:-Systemd-failed-units.mdsystemd-failed-units

Audio/Media Modules

User asks about...Read this fileModule name
PulseAudio volumedocs/Module:-PulseAudio.mdpulseaudio
PulseAudio sliderdocs/Module:-PulseAudio-Slider.mdpulseaudio/slider
WirePlumber/PipeWiredocs/Module:-WirePlumber.mdwireplumber
JACK audiodocs/Module:-JACK.mdjack
Sndio audiodocs/Module:-Sndio.mdsndio
MPD music playerdocs/Module:-MPD.mdmpd
MPRIS media controldocs/Module:-MPRIS.mdmpris
Cava audio visualizerdocs/Module:-Cava.mdcava
Cava with GLSL shadersdocs/Module:-Cava:-GLSL.mdcava
Cava raw outputdocs/Module:-Cava:-Raw.mdcava

Input/Display Modules

User asks about...Read this fileModule name
Screen brightnessdocs/Module:-Backlight.mdbacklight
Brightness sliderdocs/Module:-Backlight-Slider.mdbacklight/slider
Keyboard state (caps, num)docs/Module:-Keyboard-State.mdkeyboard-state
Input languagedocs/Module:-Language.mdlanguage
Image displaydocs/Module:-Image.mdimage
Privacy indicatorsdocs/Module:-Privacy.mdprivacy

Connectivity Modules

User asks about...Read this fileModule name
Network statusdocs/Module:-Network.mdnetwork
Bluetoothdocs/Module:-Bluetooth.mdbluetooth

Workspace/Compositor Modules

User asks about...Read this fileModule name
Generic workspacesdocs/Module:-Workspaces.mdwlr/workspaces
Sway workspaces, mode, window, scratchpaddocs/Module:-Sway.mdsway/*
Hyprland workspaces, window, submapdocs/Module:-Hyprland.mdhyprland/*
River tags, mode, window, layoutdocs/Module:-River.mdriver/*
Niri workspaces, window, languagedocs/Module:-Niri.mdniri/*
Dwl tags, windowdocs/Module:-Dwl.mddwl/*
Taskbar (window list)docs/Module:-Taskbar.mdwlr/taskbar
System traydocs/Module:-Tray.mdtray
Tray applet configurationdocs/Tray-Applets.md(tray extras)

Utility Modules

User asks about...Read this fileModule name
Date and timedocs/Module:-Clock.mdclock
Custom scripts/outputdocs/Module:-Custom.mdcustom/*
Custom module examplesdocs/Module:-Custom:-Examples.md(examples)
Custom menusdocs/Module:-Custom:-Menu.md(menus)
Third-party custom modulesdocs/Module:-Custom:-Third-party.md(third-party)
Grouping modulesdocs/Module:-Group.mdgroup/*
Idle inhibitordocs/Module:-Idle-Inhibitor.mdidle_inhibitor
GameMode statusdocs/Module:-Gamemode.mdgamemode
Power profilesdocs/Module:-PowerProfilesDaemon.mdpower-profiles-daemon
User infodocs/Module:-User.mduser

Development

TopicFile
Creating custom modulesdocs/Writing-Modules.md
CFFI (foreign function)docs/Module:-CFFI.md
Module statesdocs/States.md

Keyword Quick Reference

Common search terms -> doc file:

  • volume, audio, sound -> Module:-PulseAudio.md or Module:-WirePlumber.md
  • wifi, ethernet, internet -> Module:-Network.md
  • time, date, clock format -> Module:-Clock.md
  • colors, font, styling -> Styling.md
  • icons, fonts, nerd fonts -> Styling.md + FAQ.md
  • click actions, on-click -> Individual module docs (most support it)
  • tooltip, hover -> Individual module docs
  • format, format-icons -> Individual module docs
  • workspaces, tags -> Compositor-specific module docs
  • custom script, exec -> Module:-Custom.md
  • slider, scroll -> Module:-PulseAudio-Slider.md, Module:-Backlight-Slider.md
  • multiple bars, multi-monitor -> Configuration.md
  • hide, autohide -> Configuration.md
  • layers, exclusive zone -> Configuration.md

Config Structure Overview

jsonc
// ~/.config/waybar/config.jsonc
{
    "layer": "top",          // top or bottom layer
    "position": "top",       // top, bottom, left, right
    "height": 30,            // bar height in pixels
    "modules-left": ["sway/workspaces", "sway/mode"],
    "modules-center": ["clock"],
    "modules-right": ["network", "battery", "tray"],

    // Module-specific configuration
    "clock": {
        "format": "{:%H:%M}",
        "tooltip-format": "{:%Y-%m-%d}"
    }
}

Style Structure Overview

css
/* ~/.config/waybar/style.css */
* {
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
}

window#waybar {
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

#clock, #battery, #network {
    padding: 0 10px;
}