Sway, using conky as bar

So while it is important to know how to use Gnome on a linux desktop, the fact is that it is not my favorite desktop environment for linux. It is far too “dumbed-down” and made mostly for the masses, and I tend to be more of a “power-user”.

In the past, I became a big fan of the I3 tiling window manager. It just fit the way that I work, and I found myself highly productive with it. But I3 was made to integrate with Xorg, and that was beginning to show its age, so the community has been working on a more modern replacement for X, being Wayland. But I3 doesn’t work with Wayland! The horror!

Thankfully, some helpful devs thought of that, and wrote Sway, which is basically I3 for Wayland. Yay!

So, I’ve been trying to figure out how to use it. Once it was set up, I wanted status along the top of the screen. I did look at the recommended Waybar, but I didn’t like it very much. I likely gave up on it too quickly, but a really simple solution turns out to be Conky, specifically the cli version of it. The status command will happily read from a script that updates itself every second, and conky-cli can do so easily.

 $ cat conky.conf
-- vim: ft=lua:

-- Configuration settings: https://conky.cc/config_settings
conky.config = {
    lua_load = "~/.config/conky/conkylib.lua",
    cpu_avg_samples = 4,
    net_avg_samples = 2,
    update_interval = 1,
}

conky.text = [[
๐ŸŒก${execi 3600 weather | grep 'Current Conditions' | awk -F: '{print $2}'} | \
โฑ $uptime | \
๐Ÿ“ˆ $loadavg | \
๐Ÿ”ง $cpu% | \
๐Ÿงฎ $mem | \
๐ŸŒ€ $swap/$swapmax | \
๐Ÿ’ฝ /: ${fs_free /} free ${fs_used /} used | \
${addr enx3448ed9dc42d} | \
โ–ผ ${lua format %8s ${downspeed enx3448ed9dc42d}} โ–ฒ ${lua format %8s ${upspeed enx3448ed9dc42d}} | \
โŒ› ${time %A, %B %e, %Y} ${time %H:%M:%S}
]]

And my little lua library is pretty simple

 $ cat conkylib.lua
-- vim: ft=lua:
do
    function conky_format(fmt, input)
        local value = conky_parse(input)
        return string.format(fmt, value)
    end
end

From there, configure “status_command conky” in your ~/.config/sway/config file, and it just works.

conky screenshot image

conky screenshot