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