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.

Another (development) version, intended to work on both Sway and i3, gives me a headache. On one of my machines it works well on i3, but loops on another one. Since I don’t really need it on i3, it may or may not be further developed.

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.