feat: add WireGuard Waybar custom module #13

Open
Hermes wants to merge 2 commits from feat/wireguard-waybar-module into master
Collaborator

Summary

Adds a Waybar custom module to display WireGuard VPN status in the bar.

Changes

  • scripts/wireguard-status.sh — Shell script that outputs JSON for Waybar:

    • Connected: shows lock icon with human-readable TX/RX stats (e.g. 🔒 ↓1.0 GiB ↑500.0 MiB)
    • Disconnected: shows unlock icon with descriptive tooltip
    • Detects wg not installed gracefully
    • Tooltip includes interface name, peer, endpoint, IP, and TX/RX totals
    • NixOS-compatible path resolution for wg and ip binaries
    • Environment variable overrides for icons (WG_ICON_LOCKED, WG_ICON_UNLOCKED)
  • waybar/.config/waybar/modules.json — Added custom/wireguard module:

    • 10-second polling interval
    • return-type: json
    • Left-click: opens kitty with sudo wg-quick up work-laptop
    • Right-click: opens kitty with sudo wg-quick down work-laptop
  • waybar/.config/waybar/config.jsonc — Added custom/wireguard to modules-right (between network and battery)

  • waybar/.config/waybar/style.css — Added #custom-wireguard styling:

    • Default background matches other modules
    • .connected class highlights with @color5
    • .disconnected class uses standard module background
  • README.org — Added WireGuard module section with setup instructions:

    • Install openresolv
    • Configure sudo NOPASSWD for wg-quick
    • Refresh Waybar

Verification

  • Script passes bash -n syntax check
  • Config follows existing Waybar module conventions
  • Keybinds: $mainMod+Ctrl+V connect / $mainMod+Ctrl+Shift+V disconnect (merged from feat/wireguard-keybinds branch)
## Summary Adds a Waybar custom module to display WireGuard VPN status in the bar. ### Changes - **scripts/wireguard-status.sh** — Shell script that outputs JSON for Waybar: - Connected: shows lock icon with human-readable TX/RX stats (e.g. `🔒 ↓1.0 GiB ↑500.0 MiB`) - Disconnected: shows unlock icon with descriptive tooltip - Detects `wg` not installed gracefully - Tooltip includes interface name, peer, endpoint, IP, and TX/RX totals - NixOS-compatible path resolution for `wg` and `ip` binaries - Environment variable overrides for icons (`WG_ICON_LOCKED`, `WG_ICON_UNLOCKED`) - **waybar/.config/waybar/modules.json** — Added `custom/wireguard` module: - 10-second polling interval - `return-type: json` - Left-click: opens kitty with `sudo wg-quick up work-laptop` - Right-click: opens kitty with `sudo wg-quick down work-laptop` - **waybar/.config/waybar/config.jsonc** — Added `custom/wireguard` to `modules-right` (between network and battery) - **waybar/.config/waybar/style.css** — Added `#custom-wireguard` styling: - Default background matches other modules - `.connected` class highlights with `@color5` - `.disconnected` class uses standard module background - **README.org** — Added WireGuard module section with setup instructions: - Install openresolv - Configure sudo NOPASSWD for wg-quick - Refresh Waybar ### Verification - Script passes `bash -n` syntax check - Config follows existing Waybar module conventions - Keybinds: `$mainMod+Ctrl+V` connect / `$mainMod+Ctrl+Shift+V` disconnect (merged from feat/wireguard-keybinds branch)
Hermes added 2 commits 2026-05-20 18:33:40 +00:00
- Added scripts/wireguard-status.sh — JSON output with lock/unlock icons,
  human-readable TX/RX stats, tooltip with peer/endpoint/IP details
- Added custom/wireguard module to Waybar modules.json (10s interval, JSON
  return type, click left/right for up/down)
- Added custom/wireguard to modules-right bar config
- Added CSS for #custom-wireguard (connected/disconnected classes)
- Added openresolv install and Waybar refresh instructions to README.org
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/wireguard-waybar-module:feat/wireguard-waybar-module
git checkout feat/wireguard-waybar-module
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gortium/dotfiles#13
No description provided.