// =============================================================================
//
// Waybar configuration
//
// Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
//
// =============================================================================

[
    // 
    // Top Bar
    //
    {
        "name": "top",
        "layer": "top",
        "position": "top",
        "reload_style_on_change": true,
        "height": 45,

        "include": [
            "$WAYBAR_CONFIG_DIR/modules/eink.json",
            "$WAYBAR_CONFIG_DIR/modules/hardware.json",
            "$WAYBAR_CONFIG_DIR/modules/light.json",
            "$WAYBAR_CONFIG_DIR/modules/misc.json",
            "$WAYBAR_CONFIG_DIR/modules/sway.json",
        ],

        "modules-left": [
            "custom/smenu", // Launcher Menu
            "custom/oskb", // On Screen Keyoard

            "custom/mvws_prev",
            "custom/gows_prev",
            "custom/gows_next",
            "custom/mvws_next",
            "custom/splitv",
            "custom/splith",
        ],
        "modules-center": [
            "sway/mode",
            "sway/window",
        ],
        "modules-right": [
            "custom/win_hint#bitdepth",
            "custom/win_hint#convert",
            "custom/win_hint#redraw",

            "custom/pad",
            "custom/refresh_screen",
            "custom/pad",

            "idle_inhibitor",
            "battery",
            "tray",
            "custom/kill",
        ],

        "group/default-hints": {
            "orientation": "inherit",
            "module": [
                "custom/hint_bitdepth",
            ],
        },

    },

    //
    // Right Bar
    //
    {
        "name": "bar-right",
        "ipc": true,
        "id": "bar-ctrl",
        "layer": "top",
        "exclusive": false,
        "position": "right",
        "reload_style_on_change": true,
        "passthrough": false,

        "include": [
            "$WAYBAR_CONFIG_DIR/modules/eink.json",
            "$WAYBAR_CONFIG_DIR/modules/light.json",
            "$WAYBAR_CONFIG_DIR/modules/misc.json",
            "$WAYBAR_CONFIG_DIR/modules/network.json",
            "$WAYBAR_CONFIG_DIR/modules/sound.json",
            "$WAYBAR_CONFIG_DIR/modules/sway.json",
        ],

        "modules-center": [
            "group/baricon",
            "custom/pad",
            "group/sliders",
            "custom/pad",
            "group/ebc",
            "custom/pad",
            "group/debug",
        ],

        "group/baricon": {
            "modules": [
                "custom/closebar",
                "custom/pad#w",
                "custom/pad#w",
                "custom/pad#w",
                "custom/sway-rotate",
            ]
        },

        "group/sliders" : {
            "modules": [
                "group/cool_light",
                "group/warm_light",
                "group/soundbar",
                "group/bluetooth",
                "group/wifi",
            ]
        },

        "group/warm_light": {
            "modules": [
                "custom/light_icon_warm",
                "backlight/slider#warm-v",
            ]
        },

        "group/cool_light": {
            "modules": [
                "custom/light_icon_cool",
                "backlight/slider#cool-v",
            ]
        },

        "group/soundbar": {
            "modules": [
                "pulseaudio",
                "pulseaudio/slider",
            ]
        },

        "group/bluetooth": {
            "modules": [
                "bluetooth#icon",
                "bluetooth#label"
            ]
        },

        "group/wifi": {
            "modules": [
                "network#wifi-icon",
                "network#wifi-label"
            ]
        },

        "group/ebc": {
            "modules": [
                "custom/hint-round#bitdepth",
                "custom/hint-round#convert",
                "custom/hint-round#redraw",
                "custom/eink_mode#dither",
                "custom/eink_mode#driver",
            ],
        },

        "group/debug": {
            "modules": [
                "group/reload",
                "group/dumps",
            ],
        },

        "group/reload": {
            "orientation": "horizontal",
            "modules": [
                "custom/reload#icon",
                "custom/reload#sway",
                "custom/reload#waybar",
                "custom/reload#eink",
            ],

            "drawer": {
                "click-to-reveal": true
            }
        },

        "group/dumps": {
            "orientation": "horizontal",
            "modules": [
                "custom/debugicon",
                "custom/eink_debug",
            ],
            "drawer": {
                "click-to-reveal": true,
            }
        },

        "custom/closebar": {
            "format": "󰅖",
            "tooltip": false,
            "on-click": "swaymsg bar hidden_state hide bar-ctrl"
        },

        "custom/pad#w": {
            "format": " "
        }
    }
]
