// 😉 Config created by Felipe Facundes
//  Telegram: @FeFacundes
//  Telegram Group: t.me/winehq_linux
// 😅 Dúvidas:https://github.com/Alexays/Waybar/wiki/Module:-Custom
// vim:ft=json

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

	"modules-left": [
        "custom/rofi",
        "custom/right-arrow-dark",
		"custom/right-arrow-light",
        "custom/arquivos",
        "custom/right-arrow-dark",
		"custom/right-arrow-light",
        "custom/firefox",
        "custom/right-arrow-dark",
		"custom/right-arrow-light",
        "custom/telegram",
        "custom/right-arrow-dark",
		"custom/right-arrow-light",
        "custom/pacman",
        "custom/right-arrow-dark",
		"custom/right-arrow-light",
		"sway/workspaces",
		"custom/right-arrow-dark"
	],
	"modules-center": [
		"custom/left-arrow-dark",
		"clock#1",
		"clock#2",
		"clock#3",
		"custom/right-arrow-dark"
	],
	"modules-right": [
		"custom/left-arrow-dark",
		"pulseaudio",
		"custom/left-arrow-light",
		"custom/left-arrow-dark",
		"memory",
		"custom/left-arrow-light",
		"custom/left-arrow-dark",
		"cpu",
		"custom/left-arrow-light",
		"custom/left-arrow-dark",
        "temperature",
		"custom/left-arrow-light",
		"custom/left-arrow-dark",
		"battery",
		"custom/left-arrow-light",
		"custom/left-arrow-dark",
		"tray",
        "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": "⨇rcⱨ",
        "on-click": "pcmanfm menu://applications",
        "on-click-right": "rofi -show drun -theme ~/.config/rofi/center.rasi",
        "on-click-middle": "pkill -9 rofi"
    },
        "custom/pacman": {
        // "format": "Ⲣ  Ꝓ ⰐℙꝒᎮᗣᗧ•🍒 {}",
        "format": "Ⲣᗣᗧ•{}🍒",
        "interval": 1,                        // every hour
        "exec": "pacman -Qq | wc -l",         // packages
        "exec-if": "exit 0",                  // always run; consider advanced run conditions
        "on-click": "sakura -e 'sudo pacman -Syyu --noconfirm'; pkill -SIGRTMIN+8 waybar", // update system
        "signal": 8
    },
    "custom/terminal": {
		"format": "",
        "on-click": "sakura -m",
        "on-click-right": "sakura -s",
        "on-click-middle": "pkill -9 sakura"
    },
    "custom/arquivos": {
		"format": "",
        "on-click": "pcmanfm",
        "on-click-right": "sakura -e ranger",
        "on-click-middle": "bash -c 'pkill -9 pcmanfm ; pkill -9 ranger'"
    },
    "custom/firefox": {
		"format": "",
        "on-click": "firefox",
        "on-click-right": "firefox --new-tab",
        "on-click-middle": "firefox --private-window"
    },
    "custom/telegram": {
		"format": "",
        "on-click": "firefox --new-tab https://web.telegram.org/#/im?p=s1412203547_9544746212951555718",
        "on-click-right": "https://web.telegram.org/",
        "on-click-middle": "https://web.telegram.org/"
    },
	"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": " {:%H:%M}",
		"tooltip": false,
        "on-click": "gsimplecal"
	},
	"clock#3": {
		"format": " {:%d-%m}",
		"tooltip": false,
        "on-click": "gsimplecal"
	},
	"pulseaudio": {
		"format": "{icon} {volume}%",
		"format-bluetooth": "{icon}  {volume}%",
		"format-muted": "MUTE",
		"format-icons": {
			"headphones": "",
			"default": [
				"",
				""
			]
		},
		"scroll-step": 5,
		"on-click": "pactl set-sink-mute 0 toggle",
		"on-click-right": "pavucontrol"
	},
	"memory": {
		"interval": 2,
		"format": " {}%",
        "on-click": "sakura -e htop"
	},
	"cpu": {
		"interval": 2,
		"format": "{usage:2}%",
        "on-click": "sakura -e watch cpupower frequency-info"
    },
    "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"
	},
	"battery": {
        "interval": 2,
		"states": {
			"good": 95,
			"warning": 30,
			"critical": 15
		},
		"format": "{icon} {capacity}%",
        "format-charging": " {capacity}%",
        "format-plugged": " {capacity}%",
		"format-icons": [
			"",
			"",
			"",
			"",
			""
		]
	},
    "custom/desligar": {
    "format": "",
    "on-click": "swaynag -t warning -m 'Opções de desligamento' -b 'Sair' 'swaymsg exit' -b 'Reiniciar' 'swaymsg exec reboot' -b 'Desligar' 'openrc-shutdown -p now && systemctl poweroff'"
    },
	"tray": {
		"icon-size": 15
	}
}
