Sway box configs - some tips & observations

Sharing is caring. This may be old news to you ‘sway gurus’ out there, but as I’m learning I thought I’d share some breadcrumbs for others down the road…

I’ve been struggling a bit while trying to migrate from i3wm to sway. Something I’ve missed has been those boxes around each container within a workspace when there are multiple panels, in order to visually separate them. And to feature the active focused container in some highlighted way.

I’ve discovered that adding these lines within ~/.config/sway/config makes for a nice “EOS-friendly themed” result. (The purple is the #770077 color. Edit to suit your taste).

#class                 Border    Background  Text        Indicator  Child border
client.focused          #111111   #000000     #ffffff     #770077    #770077
client.unfocused        #333333   #111111     #ffffff     #000000    #333333
client.focused_inactive #333333   #1d1f21     #ffffff     #333333    #333333

Note: If you make the “indicator” above a different color, one of the four sides of those containers will be that different color. Personally, I find that color difference to be more distracting than helpful - i.e., it’s chromatic noise :wink: But if you prefer that, go for it.

Fattening up the width of the borders also helps (I like 4 px; again, adjust to taste):

default_border pixel 4
default_floating_border pixel 4
for_window \[app_id="^.\*"\] border pixel 4

If you don’t have these settings already, consider including these next lines in your ~/.config/sway/config file. They will assure that if there’s only a single container within a given workspace, you won’t be distracted with any box(es) and get that real estate back.

set $smart_borders on and…

hide_edge_borders smart
I think both together they may be redundant (?) but seem to work just fine to achieve this purpose.

Would enjoy hearing about any related config tweaks you’ve made to your own setup. Enjoy!

The beauty of wm’s, in general, is they tend to be quite customizable. I like them, my way. That’s is as it should be. And the sharing of ideas and help, when you uncover new ‘tricks’, is simply great.