{
  "layer": "top",
  "position": "top",
  "height": 34,
  "spacing": 16,
  "modules-left": ["niri/workspaces", "custom/music"],
  "modules-center": ["clock"],
  "modules-right": ["privacy", "cpu", "memory", "wireplumber", "group/tray", "battery"],

  "cava": {
          "framerate": 30,
          "autosens": 1,
          "sensitivity": 100,
          "bars": 14,
          "lower_cutoff_freq": 50,
          "higher_cutoff_freq": 10000,
          "method": "pulse",
          "source": "auto",
          "stereo": true,
          "reverse": false,
          "bar_delimiter": 0,
          "monstercat": false,
          "waves": false,
          "noise_reduction": 0.77,
          "input_delay": 2,
          "format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ],
          "actions": {
                     "on-click-right": "mode"
                     }
      },

  "wlr/taskbar": {
      "format": "{icon}",
      "icon-size": 14,
      "icon-theme": "Numix-Circle",
      "tooltip-format": "{title}",
      "on-click": "activate",
      "on-click-middle": "close",
      "ignore-list": [
         "Alacritty"
      ],
      "app_ids-mapping": {
        "firefoxdeveloperedition": "firefox-developer-edition"
      },
      "rewrite": {
          "Firefox Web Browser": "Firefox",
          "Foot Server": "Terminal"
      }
  },

  "pulseaudio/slider": {
      "min": 0,
      "max": 100,
      "orientation": "horizontal"
  },

  "privacy": {
  	"icon-spacing": 4,
  	"icon-size": 18,
  	"transition-duration": 250,
  	"modules": [
  		{
  			"type": "screenshare",
  			"tooltip": true,
  			"tooltip-icon-size": 24
  		},
  		{
  			"type": "audio-out",
  			"tooltip": true,
  			"tooltip-icon-size": 24
  		},
  		{
  			"type": "audio-in",
  			"tooltip": true,
  			"tooltip-icon-size": 24
  		}
  	]
  },

  "custom/music": {
    "format": "{}",
    "exec": "cat /tmp/song_detail_last 2>/dev/null",
    "interval": 1,
    "on-click": "bash ~/.config/scripts/shared/playerctl_active.sh play-pause",
    "on-click-right": "bash ~/.config/scripts/shared/show_cover.sh",
    "on-click-middle": "bash ~/.config/scripts/shared/media_menu.sh",
    "on-scroll-up": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+",
    "on-scroll-down": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
  },

  "custom/usb": {
    "format": "{}",
    "exec": "bash ~/.config/scripts/system/usb_menu.sh waybar",
    "interval": 10,
    "return-type": "json",
    "tooltip": true,
    "on-click": "bash ~/.config/scripts/system/usb_menu.sh menu",
    "on-click-right": "bash ~/.config/scripts/system/usb_menu.sh replug-keyboard",
    "on-click-middle": "bash ~/.config/scripts/system/usb_menu.sh all-replug"
  },

  "custom/power": {
    "format": "\uf011",
    "tooltip": true,
    "tooltip-format": "Power menu (Mod+Escape)",
    "on-click": "bash ~/.config/scripts/system/power_menu.sh"
  },

  "custom/camera": {
    "format": "{text}",
    "exec": "bash ~/.config/scripts/waybar/camera_monitor.sh bar",
    "interval": 1,
    "return-type": "json",
    "tooltip": true
  },

  "wireplumber": {
    "format": "{icon} {volume}% ",
	"on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
    "format-icons": ["", "", ""],
    "on-click-right": "pavucontrol",
    "format-muted": "\uf00d {volume}%"
  },

  // niri equivalent of hyprland/workspaces. "active-only" does not exist here;
  // "current-only" is the same idea. The named app workspaces (code, github, ...)
  // show by their name — add them to "ignore-workspaces" to hide them.
  "niri/workspaces": {
  	"format": "{value}",
  	"current-only": true
  },
  "niri/window": {
    "format": "{title}"
  },
  "idle_inhibitor": {
    "format": "{icon}",
    "format-icons": {
      "activated": "\uf06e",
      "deactivated": "\uf070"
    }
  },
  "network": {
  	"interface": "enp4s0f4u2u1c2",
  	"format": "{ifname}",
  	"format-wifi": "{essid} ({signalStrength}%) ",
  	"format-ethernet": "{ifname} ",
  	"format-disconnected": "",
  	"tooltip-format": "{ifname}",
  	"tooltip-format-wifi": "{essid} ({signalStrength}%) ",
  	"tooltip-format-ethernet": "{ifname} ",
  	"tooltip-format-disconnected": "Disconnected",
  	"max-length": 50
  },
  "cpu": {
    "interval": 1,
    "format": "{usage}%"
  },
  "memory": {
    "interval": 1,
    "format": "{used:0.1f}"
  },

  "clock": {
  "interval" : 1,
    "format": "{:%H:%M:%S | %A, %B %d, %Y }",
    "format-alt": "{:%H:%M:%S}",
    "tooltip-format": "<tt><small>{calendar}</small></tt>",
    "on-click-right": "gnome-calendar",
    "calendar": {
      "format": {
        "months": "<span color='#ffead3'><b>{}</b></span>",
        "today": "<span color='#ff6699'><b>{}</b></span>"
      }
    }
  },
  "pulseaudio": {
    "format": "{icon} {volume}%",
    "format-icons": {
      "default": ["\uf026", "\uf027", "\uf028"]
    },
    "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
    "on-click-right": "pavucontrol",
    "format-muted": "\uf00d {volume}%"
  },
  // Nested drawer: hovering the ☰ reveals the ⋯ (plus the tray icons); hovering
  // the ⋯ expands the USB and power menus. Nothing extra is claimed on the bar.
  "group/system": {
    "orientation": "horizontal",
    "drawer": {
      "transition-duration": 300,
      "transition-left-to-right": false
    },
    "modules": [
      "custom/system-toggle",
      "custom/usb",
      "custom/power"
    ]
  },

  "custom/system-toggle": {
    "format": "\u22ef",
    "tooltip-format": "USB + power"
  },

  "group/tray": {
    "orientation": "horizontal",
    "drawer": {
      "transition-duration": 300,
      "transition-left-to-right": false
    },
    "modules": [
      "custom/tray-toggle",
      "group/system",
      "tray"
    ]
  },

  "custom/tray-toggle": {
    "format": "\uf0c9",
    "tooltip": false
  },

  "tray": {
    "icon-size": 20,
    "spacing": 10
  }
}
