// -*- mode: 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)
    // Choose the order of the modules
    "modules-left": [
        "niri/workspaces",
        "sway/workspaces",
        "sway/mode",
        "sway/scratchpad",
    ],
    "modules-center": [
        "niri/window",
        "sway/window"
    ],
    "modules-right": [
        //"mpd",
        "custom/sndio",
        "cpu",
        "memory",
        "custom/battery",
        "custom/temperature",
        "backlight",
        "sway/language",
        "clock",
        "tray",
        //upower,
        "idle_inhibitor",
        "custom/power"
    ],
    // Modules configuration
    // "sway/workspaces": {
    //     "disable-scroll": true,
    //     "all-outputs": true,
    //     "warp-on-scroll": false,
    //     "format": "{name}: {icon}",
    //     "format-icons": {
    //         "1": "",
    //         "2": "",
    //         "3": "",
    //         "4": "",
    //         "5": "",
    //         "urgent": "",
    //         "focused": "",
    //         "default": ""
    //     }
    // },
    "sway/mode": {
        "format": "<span style=\"italic\">{}</span>"
    },
    "sway/scratchpad": {
        "format": "{icon} {count}",
        "show-empty": false,
        "format-icons": ["", ""],
        "tooltip": true,
        "tooltip-format": "{app}: {title}"
    },
    "mpd": {
        "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
        "format-disconnected": "Disconnected ",
        "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
        "unknown-tag": "N/A",
        "interval": 5,
        "consume-icons": {
            "on": " "
        },
        "random-icons": {
            "off": "<span color=\"#f53c3c\"></span> ",
            "on": " "
        },
        "repeat-icons": {
            "on": " "
        },
        "single-icons": {
            "on": "1 "
        },
        "state-icons": {
            "paused": "",
            "playing": ""
        },
        "tooltip-format": "MPD (connected)",
        "tooltip-format-disconnected": "MPD (disconnected)"
    },
    "idle_inhibitor": {
        "format": "{icon}",
        "format-icons": {
            "activated": "",
            "deactivated": ""
        }
    },
    "tray": {
        // "icon-size": 21,
        "spacing": 10,
        // "icons": {
        //   "blueman": "bluetooth",
        //   "TelegramDesktop": "$HOME/.local/share/icons/hicolor/16x16/apps/telegram.png"
        // }
    },
    "clock": {
        // "timezone": "America/New_York",
        "format": "{:%H:%M}  ",
        "format-alt": "{:%Y-%m-%d}"
    },
    "cpu": {
        "format": "{usage}% ",
        "tooltip": false
    },
    "memory": {
        "format": "{}% "
    },
    "backlight": {
        // "device": "acpi_video1",
        "format": "{percent}% {icon}",
        "format-icons": ["", "", "", "", "", "", "", "", ""]
    },
    "custom/sndio": {
         "format": "   {}% ",
         "interval": 10,
         "exec": "if [ $(sndioctl -n output.mute) -eq 1 ]; then echo \"--\"; else sndioctl -n output.level | awk '{printf \"%.0f\\n\", $1 * 100}'; fi",
         "on-click": "sndioctl output.mute=! > /dev/null",
         "on-scroll-down": "sndioctl output.level=-0.01 > /dev/null",
         "on-scroll-up": "sndioctl output.level=+0.01 > /dev/null"
    },
    "custom/battery": {
        "format": "{}% 🔋",
        "interval": 5,
        "exec": "apm -l"
    },
    "custom/temperature": {
        "format": "{} °C",
        "interval": 5,
        "exec": "sysctl hw.sensors.cpu0.temp0 | cut -d \"=\" -f 2 | cut -d \".\" -f 1"
    },
    "custom/power": {
        "format" : "⏻",
        "tooltip": "Sleep",
        "on-click": "zzz"
    }
}
