{
    "layer": "top",
    "position": "top",
    "mod": "dock",
    "exclusive": true,
    "passthrough": false,
    "gtk-layer-shell": true,
    "height": 30,
    "modules-left": [
        "custom/launcher",
        "wlr/workspaces",
        "custom/playerctl",
        "custom/playerlabel"
    ],
    "modules-center": [
        "hyprland/window",
        "wlr/taskbar"

    ],
    "modules-right": [
        "custom/weather",
        //"custom/weather_sway",
        //"network",
        "idle_inhibitor",
        "cpu",
        "memory",
        "disk",
        "temperature",
        "battery",
        //"custom/PBPbattery",
        "pulseaudio",
        //"pulseaudio_pamixer",
        //"pulseaudio_pamixer#microphone",
        //"custom/keyboard-layout",
        "backlight#icon",
        "backlight#value",
        "custom/updates",
        "clock",
        "tray",
        //"custom/power",
        "custom/lock_screen",
        "custom/light_dark"
    ],
    "custom/launcher": {
        "format": "  ",
        "on-click": "sh -c '(sleep 0.5s; pkill wofi || wofi -c ~/.config/wofi/config-lmenu)' & disown",
        "tooltip": false
    },
    "wlr/workspaces": {
        "disable-scroll": true,
        "all-outputs": true,
        "on-click": "activate",
        "on-scroll-up": "hyprctl dispatch workspace -1",
        "on-scroll-down": "hyprctl dispatch workspace +1",
        "persistent_workspaces": {
            "1": [],
            "2": [],
            "3": [],
            "4": [],
            "5": [],
            "6": [],
            "7": [],
            "8": [],
            "9": [],
            "10": []
        }
    },
    "custom/playerctl": {
      "format": "{icon}",
      "return-type": "json",
      "max-length": 64,
      "exec": "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F",
      "on-click-middle": "playerctl play-pause",
      "on-click": "playerctl play-pause",
      //"on-click": "playerctl previous",
      "on-click-right": "playerctl next",
      "format-icons": {
        "Playing": "<span foreground='#E5B9C6'>󰒮 󰐌 󰒭 </span>",
        "Paused": "<span foreground='#928374'>󰒮 󰏥 󰒭 </span>"
      },
    },

    "custom/playerlabel": {
      "format": "<span>{}</span>",
      "return-type": "json",
      "max-length": 48,
      "exec": "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F",
      "on-click-middle": "playerctl play-pause",
      "on-click": "playerctl play-pause",
      //"on-click": "playerctl previous",
      "on-click-right": "playerctl next",
      "format-icons": {
        "Playing": "<span foreground='#E5B9C6'>󰒮 󰐌 󰒭 </span>",
        "Paused": "<span foreground='#928374'>󰒮 󰏥 󰒭 </span>"
      },
    },

    // --------------------

    "hyprland/window": {
        "format": "{}"
    },
    "wlr/taskbar": {
        "format": "{icon}",
        "icon-size": 24,
        "all-outputs": true,
        "tooltip-format": "{name} - {title}",
        "on-click": "activate",
        "on-click-middle": "close",
        "ignore-list": [
            "wofi"
        ],
	    "app_ids-mapping": {
	        "steam_app_39210": "Final Fantasy 14"
	    }
    },


    // --------------------


    "custom/weather": {
        //shows the current weather and forecast
        "tooltip" : true,
        "format" : "{}",
        "interval" : 30,
        "exec" : "~/.config/waybar/scripts/waybar-wttr.py",
        "return-type" : "json"
    },
    // to use the weather module replace <your_location> with your city or town
    // note: do not use spaces: new york would be newyork
    "custom/weather_sway": {
        "exec": "~/.config/waybar/scripts/weather.sh <your_location>",
        "return-type": "json",
        "interval": 600
    },
    "network": {
        "interval": 5,
        "format-wifi": "  {essid} ({signalStrength}%)", // Icon: wifi
        "format-ethernet": "  {ifname}: {ipaddr}/{cidr}", // Icon: ethernet
        "format-disconnected": "⚠  Disconnected",
        "tooltip-format": "{ifname}: {ipaddr}",
        "on-click": "xfce4-terminal -e 'nmtui'"
    },
    "network#vpn": {
        "interface": "tun0",
        "format": "  {essid} ({signalStrength}%)",
        "format-disconnected": "⚠  Disconnected",
        "tooltip-format": "{ifname}: {ipaddr}/{cidr}"
    },
    "idle_inhibitor": {
        "format": "{icon} ",
        "format-icons":{
            "activated": "",
            "deactivated": ""
        }
    },
    "cpu": {
        "interval": 10,
        "format": " {usage}%",
        "max-length": 10,
        "on-click": "kitty --start-as=fullscreen --title htop sh -c 'htop'"
    },
    "memory": {
        "interval": 30,
        "format": " {}%",
        "max-length": 10,
        "tooltip": true,
        "tooltip-format": "Memory - {used:0.1f}GB used",
        "on-click": "kitty --start-as=fullscreen --title htop sh -c 'htop'"
    },
    "disk": {
        "interval": 30,
        "format": "󰋊 {percentage_used}%",
        "path": "/",
        "tooltip": true,
        "tooltip-format": "HDD - {used} used out of {total} on {path} ({percentage_used}%)",
        "on-click": "kitty --start-as=fullscreen --title htop sh -c 'htop'"
    },
    "temperature": {
        "thermal-zone": 1,
        "format": " {temperatureC}°C",
        "format-alt-click": "click-right",
        "format-alt": "",
        "critical-threshold": 70,
        "format-critical": " {temperatureC}°C",
        "on-click": "kitty --start-as=fullscreen --title htop sh -c 'htop'"
    },
     "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "format": "{capacity}% {icon}",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },

    "custom/PBPbattery": {
        "exec": "~/.config/waybar/scripts/PBPbattery.sh",
        "format": "{}"
    },
    "pulseaudio": {
        "scroll-step": 1, // %, can be a float
        "format": "{icon} {volume}%",
        "format-bluetooth": "{icon} {volume}%  {format_source}",
        "format-bluetooth-muted": " {icon}  {format_source}",
        "format-muted": " ",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "וֹ",
            "headset": "  ",
            "phone": "",
            "portable": "",
            "car": "",
            "default": [""]
        },
        "on-click": "pavucontrol",
        "on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +1%",
        "on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -1%",
    },
    "pulseaudio_pamixer": {
        "format": "{icon}",
        "format-muted": "",
        "on-click": "~/.config/waybar/scripts/volume --toggle",
        "on-click-right": "pavucontrol",
        "on-scroll-up": "~/.config/waybar/scripts/volume --inc",
        "on-scroll-down": "~/.config/waybar/scripts/volume --dec",
        "scroll-step": 1,
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "tooltip": true,
        "tooltip-format": "{icon} at {volume}%"
    },
    "pulseaudio_pamixer#microphone": {
        "format": "{format_source}",
        "format-source": "",
        "format-source-muted": "",
        "on-click": "~/.config/waybar/scripts/volume --toggle-mic",
        "on-click-right": "pavucontrol",
        "on-scroll-up": "~/.config/waybar/scripts/volume --mic-inc",
        "on-scroll-down": "~/.config/waybar/scripts/volume --mic-dec",
        "scroll-step": 1,
        "tooltip": true,
        "tooltip-format": " at {volume}%"
    },
    "custom/keyboard-layout": {
        "exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4",
        // Interval set only as a fallback, as the value is updated by signal
        "interval": 30,
        "format": "  {}", // Icon: keyboard
        // Signal sent by Sway key binding (~/.config/sway/key-bindings)
        "signal": 1, // SIGHUP
        "tooltip": false,
        "on-click": "~/.config/waybar/scripts/keyhint.sh"
    },
    "backlight#icon": {
        "format": "{icon}",
        "format-icons": [""],
        "on-scroll-down": "brightnessctl -c backlight set 1%-",
        "on-scroll-up": "brightnessctl -c backlight set +1%"
    },

    "backlight#value" :{
         "format": "{percent}%",
         "on-scroll-down": "brightnessctl -c backlight set 1%-",
         "on-scroll-up": "brightnessctl -c backlight set +1%"
    },
    "tray": {
        "icon-size": 18,
        "spacing": 10
    },
    "custom/power": {
        "format":"⏻ ",
        "on-click": "exec ~/.config/waybar/scripts/power-menu.sh",
        "tooltip": false
    },
    "custom/lock_screen": {
        "format": "",
        "on-click": "sh -c '(sleep 0.5s; swaylock)' & disown",
        "tooltip": false
    },
    "custom/light_dark": {
        "format": "󰐾",
        "on-click": "~/.config/waybar/scripts/baraction light",
        "tooltip": false
    }
}
