// -*- mode: json -*-

{
    "layer": "top",
        "position": "top",
        "margin-left": 4,
        "margin-right": 4,
        "margin-top": 0,
        "margin-bottom": 0,
        "spacing": 4,

        "modules-left": ["hyprland/workspaces","hyprland/window"],

        "modules-center": ["group/weather","tray"],

        "modules-right": ["pulseaudio","battery","network","group/info","group/power"],

        "group/power": {
            "orientation": "inherit",
            "drawer": {
                "transition-duration": 500,
                "children-class": "not-power",
                "transition-left-to-right": false,
            },
            "modules": [
                "custom/power", // First element is the "group leader" and won't ever be hidden
            "custom/powerm",
            "custom/reboot",
            "custom/quit",
            "custom/lock",
            ]
        },
        "custom/quit": {
            "format": "󰗼",
            "tooltip": true,
            "tooltip-format": "terminate session",
            "on-click": "hyprctl dispatch exit"
        },
        "custom/lock": {
            "format": "󰍁",
            "tooltip": true,
            "tooltip-format": "screenlock",
            "on-click": "swaylock --screenshots --clock --indicator --effect-pixelate 18 --effect-blur 8x8"
        },
        "custom/reboot": {
            "format": "󰜉",
            "tooltip": true,
            "tooltip-format": "reboot",
            "on-click": "reboot"
        },
        "custom/powerm": {
            "format": "",
            "tooltip": true,
            "tooltip-format": "shutdown!",
            "on-click": "sudo systemctl shutdown now"
        },
        "group/info": {
            "orientation": "inherit",
            "drawer": {
                "children-class": "group-info",
                "parent-class": "group-p-info",
                "transition-left-to-right": true,
            },
            "modules": [
                "memory", "disk", "cpu"
            ]
        },

        "hyprland/workspaces": {
            "disable-scroll": true,
            "all-outputs": true,
            "format": "{name}: {icon}  [ {windows} ]",
            "format-icons": {
                "1": "󰁕",
                "2": "󰁕",
                "3": "󰁕",
                "4": "󰁕",
                "5": "󰁕",
                "urgent": "󰊰",
                "active":  "󰢚",
                "special": "󰮯",
                "default": "󰁕"
            },
            "window-rewrite-default": "",
            "window-rewrite": {
                "foot class<nvim>": " ",
                "foot": "",
                "thorium": "󰊯",
                "class<thunar>": "󰝰",
                "mercury":"",
                "VSCodium": "",
                "title<Gear lever>": "",
                "balenaEtcher": "󱊞",
                "title<.*youtube.*>": "",
                "title<*netflix.*>": "󰝆",
                "title<nwg-look>": "",
                "title<Steam>": "󰓓",
                "title<Special Offers>": "󰓓",
                "Invidious": " ",
                "class<mercury*> title<.*github.*>": "", // Windows whose class is "firefox" and title contains "github". Note that "class" always comes first.
            },
        },
        "hyprland/window": {
            "format": "  {title}",
            "on-click-right": "$HOME/.config/hypr/scripts/screenshot_area",
            "rewrite": {
                "(.*) - NVIM": "  NeoVim",
                "(.*) — Mozilla Firefox": "󰈹  Firefox",
                "(.*) — Mercury": "󰈹  Mercury",
                "": "󰇄  Desktop",
                "(.*) Spotify Free": "󰓇  Spotify",
                "(.*) Spotify": "󰓇  Spotify",
                "(.*) Tidal": "󰽰  Tidal",
                " ~": "  pika@home",
                "(.*) - Obsidian(.*)": "󱓧  Obsidian",
            },
            "separate-outputs": false
        },

        "group/weather": {
            "orientation": "inherit",
            "drawer": {
                "transition-duration": 500,
                "children-class": "group-weather",
                "transition-left-to-right": false,
            },
            "modules": [
                "clock",
            "custom/weather"
            ]
        },
        "clock": {
            "format": "{:%H:%M}",
            "tooltip": true
        },
        "custom/weather": {
            "format": "{}°",
            "tooltip": true,
            "interval": 3600,
            "exec": "wttrbar",
            "return-type": "json"
        },

        "network": {
            "interval": 30,
            "on-click": "wl-copy $(ip address show up scope global | grep inet | head -n1 | cut -d/ -f 1 | tr -d [:space:] | cut -c5-)",
            "on-click-right": "foot $HOME/.config/hypr/scripts/wlan.sh",
            "format-wifi": "󰤨   {essid}",
            "format-ethernet": "󰈀   Wired",
            "fomat-disconnected": "󰤯   Disconnected",
            "tooltip-format-wifi": "{essid} ({signalStrength}%)",
            "tooltip-format-ethernet": "{ifname} ",
            "tooltip-format-disconnected": "Disconnected",
        },
        "pulseaudio": {
            "format": "{icon}  {volume}%",
            "format-bluetooth": "{icon} {volume}%",
            "format-muted": " ",
            "format-icons": {
                "headphones": "  ",
                "default": [
                    "  ",
                "  "
                ]
            },
            "scroll-step": 5,
            "on-click": "pamixer -t",
            "on-click-right": "pavucontrol"
        },
        "memory": {
            "interval": 8,
            "format": "{icon} {avail}GiB",
            "format-icons": "󰝪 ",
            "on-click": {
                "format": "{icon} {avail}GiB/{total}GiB"
            },
        },
        "cpu": {
            "interval": 2,
            "format": "{icon}  {load}%",
            "format-icons": " "
        },
        "battery": {
            "states": {
                "good": 95,
                "warning": 30,
                "critical": 15
            },
            "format": "{icon} {capacity}%",
            "format-icons": [
                "󰁺",
            "󰁼",
            "󰁿",
            "󰂁",
            "󰁹"
            ]
        },
        "disk": {
            "interval": 32,
            "format": "Disk {percentage_used:2}%",
            "path": "/"
        },
        "tray": {
            "icon-size": 20,
            "spacing": 10
        },
        "custom/power": {
            "format": "⏼ ",
            "on-click": "wlogout"
        },
        "css-name": "style.css"
}
