// vim: ft=jsonc
{
    "layer": "top", // Waybar at top layer
    // "position": "bottom", // Waybar position (top|bottom|left|right)
    // "height": 30, // Waybar height (to be removed for auto height)
    // "width": 1280, // Waybar width
    "spacing": 4, // Gaps between modules (4px)
    "output": "${PRIMARY_DISPLAY}",
    // Choose the order of the modules
    "modules-left": ["hyprland/workspaces", "hyprland/window"],
    "modules-center": ["custom/inhibit", "idle_inhibitor", "custom/dunst"],
    "modules-right": ["hyprland/submap", "custom/wifionice", "custom/spotify", "pulseaudio", "custom/network", "cpu", "memory", "temperature", "backlight", "battery", "clock", "tray"],
    // Modules configuration
    "hyprland/workspaces": {
        "format-alt": "{name}",
        "format-alt-click": "click-middle",
        "disable-scroll": false,
        "sort-by-number": true,
        "all-outputs": true,
        "warp-on-scroll": false,
        "format": "{name}: {icon}",
        "format-icons": {
            "1": "",
            "2": "",
            "3": "",
            "4": "",
            "5": "",
            "urgent": "",
            "focused": "",
            "default": ""
        }
    },
    "custom/spotify": {
        "format-alt": "{status_icon} {title}",
        "format-alt-click": "click-middle",
        "exec": "/usr/bin/python3 ~/.config/waybar/scripts/mediaplayer.py --player spotify",
        "format": "{status_icon} {artist} - {title}",
        "return-type": "json",
        "escape": true,
        "on-click": "playerctl play-pause",
        "on-scroll-up": "playerctl next",
        "on-scroll-down": "playerctl previous"
    },
    "custom/debug": {
        "format": "{}",
        "exec": "~/test.sh",
        "return-type": "json",
        "escape": true,
        "interval": 3
    },
    "custom/inhibit": {
        "format": "☕",
        "on-click": "systemd-inhibit --what=handle-lid-switch --who=waybar --why='Inhibiting suspend' --mode=block sleep 120 & notify-send 'Inhibiting suspend' 'Waybar will prevent the system from suspending for 2 minutes'"
    },
    "custom/dunst": {
        "exec": "~/.config/waybar/scripts/dunst.sh",
        "return-type": "json",
        "on-click": "dunstctl set-paused toggle",
        "on-click-middle": "dunstctl context",
        "on-click-right": "dunstctl history-pop",
        "restart-interval": 1
    },
    "custom/wifionice": {
        "format-alt": "{:.2}", // only show train :D
        "format-alt-click": "click-middle",
        "exec": "~/.config/waybar/scripts/wifionice.sh",
        "escape": true
    },
    "idle_inhibitor": {
        "format": "{icon}",
        "format-icons": {
            "activated": "",
            "deactivated": ""
        }
    },
    "tray": {
        // "icon-size": 21,
        "spacing": 10
    },
    "clock": {
        // "timezone": "America/New_York",
        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
        "format-alt": "{:%Y-%m-%d}"
    },
    "cpu": {
        "format": "{usage}% ",
        "tooltip": false
    },
    "memory": {
        "format": "{}% "
    },
    "temperature": {
        // "thermal-zone": 2,
        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
        "critical-threshold": 80,
        // "format-critical": "{temperatureC}°C {icon}",
        "format": "{temperatureC}°C {icon}",
        "format-icons": ["", "", ""]
    },
    "backlight": {
        // "device": "acpi_video1",
        "format": "{percent}% {icon}",
        "format-icons": ["", "", "", "", "", "", "", "", ""]
    },
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "format": "{capacity}% {icon}",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        "format-alt": "{time} {icon}",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },
    "custom/network": {
        "format": "{}",
        "max-length": 40,
        "escape": true,
        "exec": "$HOME/.config/hypr/hooks/networkmanager.sh 2> /dev/null" // Script in resources folder
    },
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "format": "{volume}% {icon} {format_source}",
        "format-bluetooth": "{volume}% {icon} {format_source}",
        "format-bluetooth-muted": " {icon} {format_source}",
        "format-muted": " {format_source}",
        "format-source": "",
        "format-source-muted": "",
        "ignored-sinks": [ "Easy Effects Sink" ],
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "on-click": "pavucontrol"
    }
}