{
  // Shared defaults & module definitions
  "layer": "bottom",
  "position": "bottom",
  "mod": "dock",
  "exclusive": true,
  "gtk-layer-shell": true,
  "passthrough": false,
  "fixed-center": true,
  "height": 32,
  "spacing": 8,
  // Hyprland
  "hyprland/workspaces": {
    "icon-size": 26,
    "spacing": 10,
    "all-outputs": true,
    "on-scroll-up": "hyprctl dispatch workspace r+1",
    "on-scroll-down": "hyprctl dispatch workspace r-1",
  },
  "hyprland/window": {
    "format": "{title}",
    "max-length": 70,
    "separate-outputs": false,
    "tooltip": true,
  },
  // System
  "cpu": {
    "interval": 5,
    "format": " {usage}%",
    "tooltip": true,
    "on-click": "alacritty -e btop",
  },
  "memory": {
    "interval": 11,
    "format": " {percentage}%",
    "tooltip": true,
    "on-click": "alacritty -e btop",
  },
  "disk#nvme0": {
    "interval": 29,
    "path": "/",
    "format": "󰋊 {percentage_used}%",
    "tooltip": true,
    "tooltip-format": "Root: {used} / {total} ({percentage_used}%)",
    "on-click": "alacritty -e bash -lc \"df -hT /; echo; sudo btrfs filesystem usage -T / 2>/dev/null || true; read -n1 -r -p 'Press any key...'\"",
  },
  "disk#nvme1": {
    "interval": 29,
    "path": "/home/cnachtigall/data",
    "format": "󰋊 {percentage_used}%",
    "tooltip": true,
    "tooltip-format": "Data: {used} / {total} ({percentage_used}%)",
    "on-click": "alacritty -e bash -lc \"df -hT /home/cnachtigall/data; echo; sudo btrfs filesystem usage -T /home/cnachtigall/data 2>/dev/null || true; read -n1 -r -p 'Press any key...'\"",
  },
  // Media
  "mpris": {
    "format": "{player_icon} {dynamic}",
    "format-paused": "{status_icon} <i>{dynamic}</i>",
    "dynamic-len": 50,
    "ellipsis": "…",
    "player-icons": {
      "default": "▶",
      "mpv": "🎵",
      "spotify": "",
    },
    "status-icons": {
      "paused": "⏸",
    },
    "on-click": "playerctl play-pause",
    "on-click-right": "playerctl next",
    "on-click-middle": "playerctl previous",
    "on-scroll-up": "playerctl position 5+",
    "on-scroll-down": "playerctl position 5-",
    "tooltip": true,
  },
  // Network / Audio / BT
  "network": {
    "format-wifi": " {essid} ({signalStrength}%)",
    "format-ethernet": " {ifname}",
    "format-disconnected": "󰌙 Disconnected",
    "tooltip": true,
    "tooltip-format": "{ifname} → {gwaddr}",
    "on-click": "nm-connection-editor",
    "on-click-right": "alacritty -e nmtui",
  },
  "pulseaudio": {
    "format": "{icon} {volume}%",
    "format-muted": " Muted",
    "scroll-step": 5,
    "interval": 30,
    "tooltip": true,
    "on-click": "pavucontrol",
    "on-click-right": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
    "on-click-middle": "bash -lc \"next=$(pactl list short sinks | awk '{print \\$1}' | awk -v cur=$(pactl get-default-sink) '\\$0!=cur{print; exit}'); if [ -n \\\"$next\\\" ]; then pactl set-default-sink $next; notify-send -a waybar 'Audio' 'Switched default sink to '$next; fi\"",
    "format-icons": {
      "alsa_output.usb-SteelSeries_Arctis_7_-00.analog-stereo": "",
      "alsa_output.pci-0000_0a_00.4.iec958-stereo": "",
      "bluez_output.50_5E_5C_2D_F3_B2.1": "",
      "default": ["", ""],
    },
  },
  "bluetooth": {
    "format": " {status}",
    "format-connected": " {device_alias} ({device_battery_percentage}%)",
    "tooltip": true,
    "on-click": "blueman-manager",
  },
  // Power
  "battery": {
    "states": {
      "good": 95,
      "warning": 30,
      "critical": 20,
    },
    "format": "{icon} {capacity}%",
    "format-alt": "{icon} {capacity}% ({time})",
    "format-charging": " {capacity}%",
    "format-full": " {capacity}%",
    "tooltip": true,
    "interval": 15,
    "format-icons": ["󰁺", "󰁼", "󰁿", "󰂂", "󰁹"],
  },
  "power-profiles-daemon": {
    "format": " {profile}",
    "tooltip": true,
    "on-click": "bash -lc 'cur=$(powerprofilesctl get); case $cur in performance) nxt=balanced;; balanced) nxt=powersave;; *) nxt=performance;; esac; powerprofilesctl set $nxt; notify-send -a waybar \"Power Profile\" \"Switched to $nxt\"'",
  },
  // Customs
  "custom/alhp": {
    "exec-if": "[ -x $HOME/.config/waybar/scripts/alhp.sh ]",
    "exec": "$HOME/.config/waybar/scripts/alhp.sh",
    "return-type": "json",
    "interval": 60,
    "signal": 3,
    "format": "{text}",
    "tooltip": true,
    "on-click": "pkill -SIGRTMIN+3 waybar",
  },
  "custom/razer-mouse-battery": {
    "exec-if": "[ -x $HOME/.config/waybar/scripts/razer_basilisk_v3_pro_battery_info.sh ]",
    "exec": "$HOME/.config/waybar/scripts/razer_basilisk_v3_pro_battery_info.sh",
    "return-type": "json",
    "interval": 30,
    "signal": 4,
    "format": "{text}",
    "tooltip": true,
    "on-click": "pkill -SIGRTMIN+4 waybar",
  },
  "custom/temps": {
    "exec-if": "command -v sensors >/dev/null",
    "exec": "bash -lc \"sensors | awk '/Tctl|Tdie|Package id 0/{gsub(/\\+|°C/,\\\"\\\"); print int($2); exit}'\"",
    "interval": 5,
    "format": " {output}°C",
    "tooltip": true,
    "on-click": "alacritty -e watch -n 1 sensors",
  },
  "custom/hyprsunset": {
    "exec-if": "[ -x $HOME/.config/waybar/scripts/hyprsunset_toggle.sh ]",
    "exec": "$HOME/.config/waybar/scripts/hyprsunset_toggle.sh --print",
    "return-type": "json",
    "interval": 60,
    "signal": 5,
    "format": "{text}",
    "tooltip": true,
    // Left click: toggle AUTO on/off (your ask)
    "on-click": "bash -lc '$HOME/.config/waybar/scripts/hyprsunset_toggle.sh --toggle-auto && pkill -SIGRTMIN+5 waybar'",
    // Right click: manual on/off (doesn’t touch auto flag)
    "on-click-right": "bash -lc '$HOME/.config/waybar/scripts/hyprsunset_toggle.sh --toggle && pkill -SIGRTMIN+5 waybar'",
    // Scroll: fine tune manual temp (useful when AUTO is OFF)
    "on-scroll-up": "bash -lc 't=$($HOME/.config/waybar/scripts/hyprsunset_toggle.sh --print | sed -n \"s/.* \\([0-9]\\+\\)K.*/\\1/p\"); [ -z \"$t\" ] && t=3800; t=$((t+200)); $HOME/.config/waybar/scripts/hyprsunset_toggle.sh --set $t && pkill -SIGRTMIN+5 waybar'",
    "on-scroll-down": "bash -lc 't=$($HOME/.config/waybar/scripts/hyprsunset_toggle.sh --print | sed -n \"s/.* \\([0-9]\\+\\)K.*/\\1/p\"); [ -z \"$t\" ] && t=3800; t=$((t-200)); if [ $t -lt 1000 ]; then t=1000; fi; $HOME/.config/waybar/scripts/hyprsunset_toggle.sh --set $t && pkill -SIGRTMIN+5 waybar'",
  },
  // Tray / Clock / Privacy
  "tray": {
    "icon-size": 18,
    "spacing": 4,
  },
  "clock": {
    "format": "{:%R | %d.%m.%Y}",
    "tooltip-format": "<tt><small>{calendar}</small></tt>",
    "calendar": {
      "mode": "year",
      "mode-mon-col": 3,
      "weeks-pos": "right",
    },
    "actions": {
      "on-click-right": "mode",
      "on-scroll-up": "shift_up",
      "on-scroll-down": "shift_down",
    },
  },
  "privacy": {
    "icon-size": 16,
    "tooltip": true,
  },
}
