 
// vim:ft=json

{
	"layer": "top",
	"position": "top",

	"modules-left": [
        "custom/rofi",
        "custom/right-arrow-dark",
        "custom/arquivos",
        "custom/right-arrow-dark",
        "custom/firefox",
        "custom/right-arrow-dark",
        "custom/terminal",
        "custom/right-arrow-dark",
		"sway/workspaces",
		"custom/right-arrow-dark"
	],
	"modules-center": [
		"custom/left-arrow-dark",
		//"clock#1",
		//"clock#2",
		//"clock#3",
        "custom/weather",
		"custom/right-arrow-dark",

	],
	"modules-right": [
		"custom/left-arrow-dark",
        "custom/media",
        "custom/left-arrow-dark",
        "network",
		"custom/left-arrow-dark",
		"custom/storage",
        "custom/left-arrow-light",
		"cpu",
        "custom/left-arrow-dark",
		"memory",
		"custom/left-arrow-dark",
        "idle_inhibitor",
		"custom/left-arrow-dark",
		"backlight",
		"custom/left-arrow-dark",
		"pulseaudio",
		"custom/left-arrow-dark",
        "temperature",
		"battery",
        "custom/left-arrow-light",
		"tray",
		"custom/left-arrow-dark",
        "custom/desligar"
	],
	"custom/left-arrow-dark": {
		"format": "",
		"tooltip": false
	},
	"custom/left-arrow-light": {
		"format": "",
		"tooltip": false
	},
	"custom/right-arrow-dark": {
		"format": "",
		"tooltip": false
	},
	"custom/right-arrow-light": {
		"format": "",
		"tooltip": false
	},
	"custom/rofi": {
		"format": " Menu",
        "on-click-right": "nwg-drawer",
        "on-click": "wofi -show run",
        "on-click-middle": "pkill -9 wofi"
    },
    "custom/terminal": {
		"format": "",
        "on-click": "alacritty",
        "on-click-middle": "pkill -9 alacritty"
    },
    "custom/arquivos": {
		"format": "",
        "on-click": "nautilus",
        "on-click-right": "alacritty -e ranger",
        "on-click-middle": "bash -c 'pkill -9 nautilus ; pkill -9 ranger'"
    },
    "custom/firefox": {
		"format": "",
        "on-click": "firedragon",
    },
	"sway/workspaces": {
		"disable-scroll": true,
		"format": "{name}"
	},
    "sway/window": {
        "max-length": 80,
        "tooltip": false
    },
	"clock#1": {
		"format": " {:%a}",
		"tooltip": false,
        "on-click": "gsimplecal"
	},
	"clock#2": {
		"format": " {:%d-%h-%Y}",
		"tooltip": false,
        "on-click": "gsimplecal"
	},
	"clock#3": {
		"format": " {:%H:%M:%S %p}",
		"tooltip": false,
        "on-click": "gsimplecal"
	},

	"pulseaudio": {
		"format": "{icon} {volume}%",
		"format-bluetooth": "{icon}  {volume}%",
		"format-muted": "MUTE",
        "format-source":  " {volume}%",
        "format-source-muted": "MUTE",
		"format-icons": {
			"headphones": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
			"default": [
				"",
				""
			]
		},
		"scroll-step": 5,
        "on-click": "pavucontrol",
		"on-click-right": "pavucontrol"
	},
    "temperature": {
        "interval": 2,
        // "thermal-zone": 2,
        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
        "critical-threshold": 80,
        // "format-critical": " {temperatureC}°C",
        "format": " {temperatureC}°C",
        "on-click": "xsensors"
	},
    "cpu": {
        "interval": 10,
        "format": " {}%",
    },
    "memory": {
        "interval": 30,
        "format": " {used:0.2f} / {total:0.0f} GB",
        "on-click": "alacritty -e htop"
    },
    "battery": {
        "interval": 2,
		"states": {
			"good": 95,
			"warning": 30,
			"critical": 15
		},
		"format": "{icon} {capacity}%",
        "format-charging": " {capacity}%",
        "format-plugged": " {capacity}%",
		"format-icons": [
			"",
			"",
			"",
			"",
			""
		]
	},
    "network": {
        "format-wifi": " {essid} ({signalStrength}%)",
        "format-ethernet": " {ifname}: {ipaddr}/{cidr}",
        "format": "",
		"format-disconnected": "",
        "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": "wl-copy $(ip address show up scope global | grep inet6 | head -n1 | cut -d/ -f 1 | tr -d [:space:] | cut -c6-)",
        "tooltip-format": " {bandwidthUpBits}  {bandwidthDownBits}\n{ifname}\n{ipaddr}/{cidr}\n",
        "tooltip-format-wifi": " {essid} {frequency}MHz\nStrength: {signaldBm}dBm ({signalStrength}%)\nIP: {ipaddr}/{cidr}\n {bandwidthUpBits}  {bandwidthDownBits}",
        "interval": 10
    },
    "custom/storage": {
        "format": " {}",
        "format-alt": "{percentage}% ",
        "format-alt-click": "click-right",
        "return-type": "json",
        "interval": 60,
        "exec": "~/.config/waybar/modules/storage.sh"
    },
    "backlight": {
        "device": "intel_backlight",
        "format": "{icon} {percent}%",
        "format-alt": "{percent}% {icon}",
        "format-alt-click": "click-right",
        //"format-icons": ["", ""],
        "format-icons": ["", ""],
        "on-scroll-down": "brightnessctl s 5%-",
        "on-scroll-up": "brightnessctl s +5%"
    },
    "idle_inhibitor": {
        "format": "{icon}idle",
        "format-icons": {
            "activated": "☼",
            "deactivated": "☀"
        }
    },
    "custom/weather": {
        "format": "{}",
        "format-alt": "{alt}: {}",
        "format-alt-click": "click-right",
        "interval": 1800,
        "return-type": "json",
        "exec": "~/.config/waybar/modules/weather.sh",
        "exec-if": "ping wttr.in -c1"
    },
        "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
    },
    "custom/desligar": {
    "format": "",
    "on-click": "wlogout"
    },
	"tray": {
		"icon-size": 15
	}
}
