let {
    $menu = { type = "menu" label = "󱓞" }
    $workspaces = { type = "workspaces" }
    $launcher = { type = "launcher" favorites = [ "firefox" ] truncate.mode = "end" truncate.max_length = 30 }

    $music = { type = "music" player_type = "mpd" }
    $battery = { type = "battery" show_if = "ls /sys/class/power_supply/ | grep --quiet '^BAT'" }
    $sys_info = { type = "sys_info" format = ["{cpu_percent}% " "{memory_percent}% "] interval.cpu = 1 }
    $clipboard = { type = "clipboard" max_items = 5 truncate.mode = "end" truncate.length = 30 }
    $volume = { type = "volume" }
    $tray = { type = "tray" }
    $clock = { type = "clock" }
    $notifications = { type = "notifications" show_if = "pgrep -x swaync" }

    $power_menu = {
        type = "custom"
        name = "power-menu"
        class = "power-menu"

        bar = [ { type = "button" name="power-btn" label = "󰐥" on_click = "popup:toggle" } ]

        popup = [ {
            type = "box"
            orientation = "vertical"
            widgets = [
                { type = "label" name = "header" label = "Power menu" }
                {
                    type = "box"
                    name = "buttons"
                    widgets = [
                        { type = "button" class="power-btn" label = "<span>󰐥</span>" on_click = "!shutdown now" }
                        { type = "button" class="power-btn" label = "<span>󰜉</span>" on_click = "!reboot" }
                    ]
                }
            ]
        } ]
    }
} in {
    icon_theme = "Paper"

    start = [ $menu $workspaces $launcher ]
    center = [ $music ]
    end = [ $battery $sys_info $clipboard $volume $power_menu $tray $clock $notifications ]
}