ArchLabs Linux

Dynamic workspace names in Sway (and i3?)

This simple script changes names of workspaces to the name of the window last focused in each of them. It works well in Sway, but not in i3. Confirmed to work with swaybar and i3-bar.

Note: in the default ArchLabs i3 config file workspaces have fixed names, and all bindings and window behavior use the names. For the script to work, we need to use numbers instead of names. See the example config file.

The script depends on the i3ipc-python package.



1 Like

Nice work @nwg!

1 Like

Wow, thanx for sharing @nwg

1 Like

After 3 days of unsuccessful testing I’m giving up on the i3 version, at least for now. It works well on one and loops on another machine, and I can’t figure out the reason. I don’t really need it on i3, since tint2 works well there, and I can stick to my t2ec and psuinfo packages. See OP for GitHub links.

A small but pleasing the eye update: the window name is now prepended with the tiling mode indicator (horizontal / vertical).

The script should work as well on sway as on i3.


Looks great @nwg

1 Like

Since it’s sometimes difficult to guess if a maximized window is floating or not, I thought to add the third glyph to represent the floating state.

1 Like