{
    "layer": "top", // Waybar at top layer
    "position": "top", // Waybar position (top|bottom|left|right)
    "height": 22, // Waybar height (to be removed for auto height)
    "spacing": 4, // Gaps between modules (4px)
    "margin-top": 5,
    "margin-right": 5,
    "margin-left": 5,
		"reload_style_on_change": true,
    // Choose the order of the modules
    "modules-left": ["tray"],
    //"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"],
    //"modules-center": [""],
    "modules-center": ["pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "custom/pacman"],
		"modules-right": ["idle_inhibitor", "custom/do-not-disturb", "clock"],
    //"modules-right": ["tray", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "clock", "custom/power"],
    // Modules configuration
    "custom/pacman": {
	    "format": "{text} ",
	    "interval": 3600,                     // every hour
	    "exec": "checkupdates | wc -l",       // # of updates
        "exec-if": "sleep 60 && [ $(checkupdates | wc -l) -gt 100 ]",
        "on-click": "wezterm start -- zsh -c 'yay; pkill -SIGRTMIN+8 waybar'",
        "signal": 8,
        "tooltip-format": "{text} updates available",
    },
    "custom/do-not-disturb": { 
        "exec": "~/.config/waybar/get_dnd_status.sh",
        "interval": "once",
        "on-click":"dunstctl set-paused toggle",
        "return-type": "json"
    },
    "idle_inhibitor": {
        "format": "<span size='medium'>{icon} </span>",
        "format-icons": {
            "activated": "",
            "deactivated": ""
        },
        "tooltip-format-activated": "Sospensione disabilitata",
        "tooltip-format-deactivated": "Sospensione abilitata"
    },
    "tray": {
        //"icon-size": 18,
        "spacing": 10
    },
		"clock": {
				"timezone": "Europe/Rome",
				"locale": "it_IT.UTF-8",
        "format": "{:L%A %d/%m/%Y %R}",
        "tooltip-format": "<tt><big>{calendar}</big></tt>",
        "calendar": {
        		"format": {
            		"months":     "<span color='#ffead3'><b>{}</b></span>",
                "days":       "<span color='#ecc6d9'><b>{}</b></span>",
                "weeks":      "<span color='#99ffdd'><b>W{}</b></span>",
                "weekdays":   "<span color='#ffcc66'><b>{}</b></span>",
                "today":      "<span color='#ff6699'><b><u>{}</u></b></span>"
            }
        },
    },
    "cpu": {
        "format": "{usage}% <span size='medium'> </span>",
        "tooltip": false
    },
    "memory": {
        "format": "{}% <span size='medium'> </span>",
					"states": {
						"warning": 80,
						"critical": 90
					},
    },
    "temperature": {
        "thermal-zone": 6,
        //"hwmon-path": "/sys/class/hwmon/hwmon4/temp1_input",
        "critical-threshold": 80,
        // "format-critical": "{temperatureC}°C {icon}",
        "format": "{temperatureC}°C {icon}",
        "format-icons": ["", "", ""]
    },
    "backlight": {
        "device": "acpi_video0",
        "format": "{percent}% {icon}",
        "format-icons": [""]
    },
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 20
        },
        "format": "{capacity}% {icon} ",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        "format-alt": "{time} {icon}",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },
    "network": {
        "format-wifi": "{essid} <span size='large'></span> ",
        //"format-wifi": "{essid} ({signalStrength}%) <span size='large'></span> ",
        "format-ethernet": "Wired <span size='large'></span> ",
        "tooltip-format": "{ifname} via {gwaddr}",
        "format-linked": "{ifname} (No IP) <span size='large'>󰥗</span>",
        "format-disconnected": "Disconnected <span size='large'>󰅤 </span>",
        "format-alt": "{ifname}: {ipaddr}/{cidr} <span size='large'></span> ",
    },
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "reverse-scrolling": true,
        "format": "{volume}% <span size='medium'>{icon} </span>",
        "format-bluetooth": "{volume}% ",
        "format-bluetooth-muted": "",
        "format-muted": "ﴓ",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", "", ""]
        },
        "on-click": "pavucontrol"
    },
		"custom/power": { 
			"format":" ",
			"on-click":"rofi -show p -modi p:'~/.config/rofi/utils/rofi-power-menu --choices shutdown/reboot/suspend --no-symbols'"
		},
    "custom/media": {
        "format": "{icon} {}",
        "return-type": "json",
        "max-length": 40,
        "format-icons": {
            "spotify": "",
            "default": "🎜"
        },
        "escape": true,
        "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
        // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
    }
}

