{
    "layer": "top",
    "height": 30,
    "spacing": 4,
    "modules-left": ["custom/launcher", "cpu", "memory", "temperature", "disk", "custom/weather", "custom/updates", "hyprland/window"],
    "modules-center": ["hyprland/workspaces"],
    "modules-right": ["custom/spotify", "pulseaudio", "network", "backlight", "keyboard-state", "hyprland/language", "battery", "battery#bat2", "clock", "tray", "custom/power"],
    "hyprland/workspaces": {
        "format": "{icon}",
        "all-outputs": true,
        "on-scroll-up": "hyprctl dispatch workspace e+1",
        "on-scroll-down": "hyprctl dispatch workspace e-1"
    },
    "keyboard-state": {
        "numlock": true,
        "capslock": true,
        "format": "{name} {icon}",
        "format-icons": {
            "locked": "",
            "unlocked": ""
        }
    },
    "tray": {
        "spacing": 10
    },
    "clock": {
        "timezone": "Asia/Tomsk",
        "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": {
        "critical-threshold": 80,
        "format": "{temperatureC}°C {icon}",
        "format-icons": ["", "", ""]
    },
    "backlight": {
        "format": "{percent}% {icon}",
        "format-icons": ["", "", "", "", "", "", "", "", ""]
    },
    "battery": {
        "states": {
            "warning": 30,
            "critical": 15
        },
        "format": "{capacity}% {icon}",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        "format-alt": "{time} {icon}",
        "format-icons": ["", "", "", "", ""]
    },
    "battery#bat2": {
        "bat": "BAT2"
    },
    "network": {
        "format-wifi": "{essid} ({signalStrength}%) 󰤨",
        "format-ethernet": "{ipaddr}/{cidr} ",
        "tooltip-format": "{ifname} via {gwaddr} ",
        "format-linked": "{ifname} (No IP) ",
        "format-disconnected": "Disconnected ⚠",
        "format-alt": "{ifname}: {ipaddr}/{cidr}"
    },
    "pulseaudio": {
        "format": "{volume}% {icon} {format_source}",
        "format-bluetooth": "{volume}% {icon} {format_source}",
        "format-bluetooth-muted": " {icon} {format_source}",
        "format-muted": " {format_source}",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "on-click": "pavucontrol"
    },
    "custom/power": {
        "format": "⏻",
        "on-click": "~/dotfiles/rofi/powermenu/powermenu.sh"
    },
    "custom/launcher": {
        "format": "",
        "on-click": "~/dotfiles/rofi/launcher/launcher.sh"
    },
    "disk": {
        "interval": 30,
        "format": " {free}",
        "unit": "GB"
    },
    "custom/spotify": {
        "format": "{} ",
        "exec": "~/.config/waybar/scripts/spotify.sh",
        "return-type": "json",
        "on-click": "playerctl -p spotify play-pause",
        "on-scroll-up": "playerctl -p spotify next",
        "on-scroll-down": "playerctl -p spotify previous",
        "exec-if": "pgrep spotfiy"
    },
    "custom/weather": {
        "format": "{}",
        "tooltip": true,
        "interval": 3600,
        "exec": "~/dotfiles/waybar/scripts/waybar-wttr.py",
        "return-type": "json"
    },
    "custom/pacman": {
        "format": "{}  ",
        "interval": 3600,                     // every hour
        "exec": "checkupdates | wc -l",       // # of updates
        "exec-if": "exit 0",                  // always run; consider advanced run conditions
        "on-click": "termite -e 'sudo pacman -Syu'; pkill -SIGRTMIN+8 waybar", // update system
        "signal": 8
    },
   "custom/updates": {
       "format": "{} {icon}",
       "return-type": "json",
       "format-icons": {
           "has-updates": "󱍷",
           "updated": "󰂪"
       },
       "exec-if": "which waybar-module-pacman-updates",
       "exec": "waybar-module-pacman-updates  --interval-seconds 5 --network-interval-seconds 300"
   },
}

