//  {{@@ header() @@}}
{
    "position":"{{@@ bar_pos @@}}",
    "layer":"top",
    "modules-left": [
        "sway/workspaces",
        "sway/mode",
        "sway/window",
    ],
    "modules-center": [
        "clock",
        "custom/weather",
    ],
    "modules-right": [
        "sway/language",
        "mpd",
        "custom/recording",
        "tray",
        "custom/mail",
        "custom/transmissionD",
        "custom/transmissionS",
        "custom/delugeD",
        "custom/delugeS",
        "custom/updates",
        "custom/caffeine",
        "pulseaudio",
        "bluetooth",
        "network",
        "battery"
    ],
    "sway/workspaces": {
        "enable-bar-scroll":true,
        "format": "{icon}",
        "format-icons": {
            "1": "",
            "2": "",
            "3": "",
            "4": "",
            "5": "",
            "6": "",
            "7": "",
            "8": "",
            "9": "",
            "10": "",
            "urgent": "",
            "focused": "",
            "default": ""
        }
    },
    "sway/window":{
        "max-length":40
    },
    "mpd": {
        "format": "{stateIcon} {title} - {artist}",
        "format-paused": "{stateIcon}",
        "format-stopped": "",
        "state-icons": {
             "paused": "",
             "playing": ""
        },
        "tooltip":false,
        "on-click": "mpc toggle",
        "on-scroll-up": "mpc vol +10",
        "on-scroll-down": "mpc vol -10",
    },
    "tray": {
        "spacing": 7,
        "icon-size":19
    },
    "clock": {
        "interval":60,
        "format":"<b>{:%H:%M %a %d/%m}</b>",
        "tooltip":false
    },
    "battery": {
        "tooltip":true,
        "states": {
            "full":100,
            "good": 95,
            "warning": 25
        },
        "format": "{icon} ",
        "format-charging": "",
        "format-plugged": "",
        "format-full": "",
        "format-warning":"{icon}  {time}",
        "format-icons": ["", "", "", "", "", ""]
    },
    "network": {
        "interval": 5,
        "tooltip":false,
        "on-click": "terminal iwd",
        "format-wifi": "{icon}",
        "format-icons":[ "", "", "", "", "" ],
        "format-ethernet": "",
        "format-linked": "",
        "format-disconnected": ""
    },
    "bluetooth": {
        "tooltip":false,
        "on-click": "terminal bluetoothctl",
        "format": "{icon}",
        "format-alt": "bluetooth: {status}",
        "format-icons": {
             "enabled": "",
             "disabled": ""
        },
        "tooltip-format": "{}"
    },
    "pulseaudio": {
        "interval": 5,
        "tooltip":false,
        "scroll-step": 10,
        "format": "{icon}",
        "format-bluetooth": "",
        "format-bluetooth-muted": "",
        "format-muted": "ﱝ",
        "format-icons": {
            "headphone": [" 奄", " 奔", " 墳"],
            "handsfree": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["奄", "奔", "墳"]
        },
        "on-click": "pavucontrol",
        "on-click-right": "pulse-sink"
    },
    "custom/weather": {
        "tooltip":false,
        "format": "<b>{}</b>",
        "exec": "jq -r '.temp +\"°C \"+ .weather' ~/.forecast.json",
        "interval": 30,
        "on-click": "terminal forecast interactive",
        "on-click-right": "xdg-open https://openweathermap.org"
    },
    "custom/mail": {
        "tooltip":false,
        "format":"{} <b></b>",
        "exec": "checkmail",
        "on-click": "terminal neomutt; pkill -SIGRTMIN+4 waybar",
        "signal": 4,
        "interval": 60
    },
    "custom/updates": {
        "tooltip":false,
        "format": "{} ",
        "interval": 3600,
        "exec": "checkupdates | wc -l | sed 's/^0$//'",
        "on-click": "terminal sh -c 'ping -qc1 archlinux.org >/dev/null && pacman -Syu || pacman -Su; pkill -SIGRTMIN+8 waybar; read'",
        "signal": 8
    },
    "custom/recording": {
        "tooltip":false,
        "exec": "pidof wf-recorder > /dev/null && echo  || echo",
        "interval": 5,
        "on-click": "pkill -2 wf-recorder; pkill -SIGRTMIN+5 waybar",
        "signal": 5
    },
    "custom/spigot":{
        "format":"{}",
        "exec":"pgrep -f spigot.jar>/dev/null && spigot command list | awk '/There are/ {if ($6) print $6}'",
        "interval":30,
        "on-click":"terminal spigot console"
    },
    "custom/transmissionD":{
        "format":" {} ",
        "exec":"transmission-remote -l | tail -n+2 | grep Down | wc -l | sed 's/^0$//'",
        "exec-if":"pidof transmission-daemon",
        "interval":30
    },
    "custom/transmissionS":{
        "format":" {} ",
        "exec":"transmission-remote -l | grep Seeding| wc -l | sed 's/^0$//'",
        "exec-if":"pidof transmission-daemon",
        "interval":30
    },
    "custom/delugeD":{
        "format":" {} ",
        "exec":"deluge-console status | perl -ne 'print $1 if /Downloading: (\\d+)/'| sed 's/^0$//'",
        "exec-if":"pidof -x deluged",
        "interval":30
    },
    "custom/delugeS":{
        "format":" {} ",
        "exec":"deluge-console status | perl -ne 'print $1 if /Seeding: (\\d+)/'| sed 's/^0$//'",
        "exec-if":"pidof -x deluged",
        "interval":30
    },
    "custom/caffeine":{
        "format":"{}",
        "exec":"pidof swayidle > /dev/null && echo 鈴 || echo ",
        "on-click":"_sway_idle_toggle",
        "interval": 1,
        "tooltip":false
    },
    "sway/language": {
        "format": "{short} {variant}",
    },
    "custom/sleep":{
        "exec":"test $(date +%H) -lt 5 && echo 'GO TO SLEEP' | trans -b",
        "interval": 60,
        "tooltip":false
    },
    "custom/unpushed": {
        "exec":"_git_check_unpushed",
        "interval": 30,
        "tooltip": false
    }

}
// vim:ft=jsonc
