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