// Global 
{
    "layer": "top",
    "position": "bottom",
    "ipc": true,

    // If height property would be not present, it'd be calculated dynamically
    //"height": 20,

    "modules-left": [
        //"custom/launcher",
        "sway/workspaces",
        "sway/mode",
    ],
 
    "modules-center": [
    ],

    "modules-right": [
        "network",
        "idle_inhibitor",
        "memory",
        "cpu",
        "pulseaudio",
        "custom/keyboard-layout",
        "battery",
        "backlight",
        "tray",
        //"custom/power",
        "clock",
    ],

    // Modules

    "idle_inhibitor": {
        "format": "{icon}",
        "format-icons":{
            "activated": "",
            "deactivated": ""
        }
    },

    "battery": {
        "states": {
            "good": 100,
            "warning": 30,
            "critical": 15
        },
        "format": "{capacity}% {icon}",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },

    "clock": {
        "interval": 1,
        "format": "{:%d-%m-%Y %H:%M:%OS}",
    },

    "cpu": {
        "interval": 1,
        "format": "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7} {avg_frequency:0.1f}GHz ", // Icon: microchip
        "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"],
        "states": {
            "warning": 70,
            "critical": 90,
        },
        "on-click": "xfce4-terminal -e 'top'",
    },

    "custom/keyboard-layout": {
        "exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4 | head -c2",
        "interval": 30, // Interval set only as a fallback, as the value is updated by signal
        "format": "{} ", // Icon: keyboard
        "signal": 1, // SIGHUP, Signal sent by Sway key binding (~/.config/sway/key-bindings)
        "tooltip": false,
        "on-click": "swaymsg input 1:1:AT_Translated_Set_2_keyboard xkb_switch_layout next",
    },

    "memory": {
        "interval": 5,
        "format" : "{icon} ",
        "tooltip" : true,
        "tooltip-format": "{used:0.1f}/{total:0.1f}G, swap {swapUsed:0.1f}/{swapTotal:0.1f}G",
        "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"],
        "on-click": "xfce4-terminal -e 'htop'", 
        "states": {
            "warning": 70,
            "critical": 90
        }
    },

    "network": {
        "interval": 5,
        "format-wifi": "{essid}: {signalStrength}% ", // Icon: wifi
        "format-ethernet": "", // Icon: ethernet
        "format-disconnected": "",
        "tooltip-format": "{ifname}: {ipaddr}",
        "tooltip-format-disconnected": "Disconnected",
//        "on-click": "xfce4-terminal -e 'nmtui'",
        "on-click-right": "wl-copy $(ip -json route get 8.8.8.8 | jq -r '.[].prefsrc')", // copy ip-address
    },

    "sway/mode": {
        "format": "{}",
        "tooltip": false
    },

    "sway/workspaces": {
        "disable-scroll": true,
        "disable-markup" : false,
        "all-outputs": true,
        "format":"{icon}",
        "format-icons": {
            //"3": "",
            //"4": "",
            //"5": "",
            //"6": "",
        }
    },

    "pulseaudio": {
        "scroll-step": 1, // %, can be a float
        "format": "{volume}% {icon}",
        "format-bluetooth": "{volume}% {icon}  {format_source}",
        "format-bluetooth-muted": "× {icon}  {format_source}",
        "format-muted": "×",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "וֹ",
            "headset": "  ",
            "phone": "",
            "portable": "",
            "car": "",
            "default": [""]
        },
        "on-click": "pavucontrol",
        "on-scroll-up": "pamixer -ui 2",
        "on-scroll-down": "pamixer -ud 2",
    },

    "tray": {
        "icon-size": 18,
        "spacing":10,
     },

    "backlight" :{
        "scroll-step": 1, // %, can be a float
        "format": "{percent}% {icon}",
        "format-icons": [""],
        "on-scroll-down": "brightnessctl -c backlight set 1%-",
        "on-scroll-up": "brightnessctl -c backlight set +1%"
    },
}
