dotfiles/config/waybar/config.org
2024-08-07 14:58:48 -05:00

2.9 KiB

Waybar Configuration

Layout

Define the layout of the bar.

    {
      "height": 30,
      "spacing": 4,
      "modules-left": ["sway/workspaces", "sway/scratchpad"],
      "modules-center": ["sway/window"],
      "modules-right": ["mpd", "pulseaudio", "network", "cpu", "memory", "clock", "tray"],

Components

Define scratchpad component.

  "sway/scratchpad": {
      "format": "{icon} {count}",
      "show-empty": false,
      "format-icons": ["", ""],
      "tooltip": true,
      "tooltip-format": "{app}: {title}"
  },

Define music player daemon component.

  "mpd": {
      "format": "{stateIcon} {artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) [{songPosition}|{queueLength}] 🎵",
      "format-disconnected": "Disconnected 🎵",
      "format-stopped": "{consumeIcon}Stopped 🎵",
      "unknown-tag": "N/A",
      "interval": 2,
      "state-icons": {
          "paused": "",
          "playing": ""
      },
      "tooltip-format": "MPD (connected)",
      "tooltip-format-disconnected": "MPD (disconnected)",
      "on-click": "foot -e ncmpcpp"
  },

Define tray component.

  "tray": {
      "icon-size": 21,
      "spacing": 10,
      "show-passive-items": true
  },

Define clock component.

  "clock": {
      "format": "{:%H:%M\t%Y-%m-%d}",
      "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
  },

Define CPU usage component.

  "cpu": {
      "format": "{usage}% ",
      "tooltip": false
  },

Define memory usage component.

  "memory": {
      "format": "{}% "
  },

Define network component.

  "network": {
      // "interface": "wlp2*", // (Optional) To force the use of this interface
      "format-wifi": "",
      "tooltip": false,
      "format-ethernet": "",
      "format-linked": "",
      "format-disconnected": "⚠",
      "format-alt": "{ifname}: {ipaddr}/{cidr}"
  },

Define audio component.

  "pulseaudio": {
          // "scroll-step": 1, // %, can be a float
          "format": "{volume}% {icon}",
          "format-bluetooth": "{volume}% {icon}",
          "format-bluetooth-muted": " {icon}",
          "format-muted": " ",
          "format-source": "{volume}% ",
          "format-source-muted": "",
          "format-icons": {
              "headphone": "",
              "hands-free": "",
              "headset": "",
              "phone": "",
              "portable": "",
              "car": "",
              "default": ["", "", ""]
          },
          "on-click": "pavucontrol"
      }
  }