The version 2.0 of swaprootname (1) has seen the world, now with less race conditions!
swaprootname [1] is your tool of choice for permanently or temporarily changing root window name, in scripts or regularly in shell. Unfortunately, previous version suffered from an issue: if you launched two instances of it, sometimes it will not restore original name properly, which is indeed annoying. The new version fixes this, and now you can have as many scripts concurrently showing useful information in root name as you want! [2] Download one today and rejoice! [1] https://github.com/ElectronicRU/swaprootname [2] Technically, X11 text properties may or may not have some maximum length, so amount of scripts is tecnically limited, but I expect this bound to be large enough. Also, race conditions may still occur, due to name changing not being instant, but chances are, they will not.