// -*- mode: jsonc -*-
{
    "layer": "top", // Waybar at top layer
    "position": "top", // Waybar position (top|bottom|left|right)
    // "height": 25,
    // "width": 1280, // Waybar width
    // Choose the order of the modules
    "modules-left": [
        "custom/apps",
        "hyprland/workspaces",
        "hyprland/window"
    ],
    "modules-center": [
        "custom/music"
    ],
    "modules-right": [
        "pulseaudio",
        "network",
        "hyprland/language",
        "clock",
        "tray",
        "custom/power"
    ],
    "hyprland/workspaces": {
        "disable-scroll": true,
        "sort-by-name": true,
        "format": "{name}",
        "format-icons": {
            "active": "",
            "default": ""
        }
    },
    "custom/apps": {
        "format": "",
        "tooltip": false,
        "tooltip-format": "Apps",
        "on-click": "wofi --show drun"
    },
    "tray": {
        "icon-size": 21,
        "spacing": 10
    },
    "custom/music": {
        "format": "  {}",
        "escape": true,
        "interval": 5,
        "tooltip": true,
        "exec": "playerctl metadata --format='{{ title }}' | sed -r 's/\\s{2,}/ /g'",
        // "exec": "playerctl metadata --format='{{artist}} - {{title}} ({{album}})' | sed -r 's/\\s{2,}/ /g'",
        "on-click": "playerctl play-pause",
        "max-length": 50
    },
    "hyprland/window": {
        "format": "{}",
        "icon": true,
        "icon-size": 18,
        "max-length": 60, // Limits the title to 60 characters
        "separate-outputs": true
    },
    "hyprland/language": {
        "format": "{}",
        "format-en": "EN",
        "format-ro": "RO",
        "on-click": "hyprctl switchxkblayout all next"
    },
    "clock": {
        "timezone": "Europe/Bucharest",
        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
        "format-alt": "{:%d/%m/%Y}",
        "format": "{:%H:%M}"
    },
    "backlight": {
        "device": "intel_backlight",
        "format": "{icon}",
        "format-icons": [
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            ""
        ]
    },
    "battery": {
        "states": {
            "warning": 30,
            "critical": 15
        },
        "format": "{icon}",
        "format-charging": "",
        "format-plugged": "",
        "format-alt": "{icon}",
        "format-icons": [
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            ""
        ]
    },
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "format": "{icon} {volume}%",
        "format-muted": "",
        "format-icons": {
            "default": [
                "",
                "",
                " "
            ]
        },
        "on-click": "pavucontrol"
    },
    "network": {
        // "interface": "wlp2*", // (Optional) To force the use of this interface
        "format-wifi": "{essid} ({signalStrength}%)",
        "format-ethernet": "{ipaddr}",
        "tooltip-format": "{ifname} via {gwaddr}",
        "format-linked": "{ifname} (No IP)",
        "format-disconnected": "Disconnected",
        "format-alt": "{ifname}: {ipaddr}/{cidr}"
    },
    "custom/lock": {
        "tooltip": false,
        "on-click": "sh -c '(sleep 0.5s; swaylock --grace 0)' & disown",
        "format": ""
    },
    "custom/power": {
        "format": "⏻",
        "tooltip": false,
        "menu": "on-click",
        "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder
        "menu-actions": {
            "shutdown": "shutdown -h now",
            "reboot": "reboot",
            "suspend": "systemctl suspend" //,
            //"hibernate": "systemctl hibernate"
        }
    }
}
