git clone https://github.com/Pismice/rename-i3-workspace
Might work with other Zig versions but that is unlikely.
zig build
mv ./zig-out/bin/rename-i3-workspace /usr/local/bin
Now from anywhere in your system, you can from your terminal use rename-i3-workspace.
This script takes 2 parameters:
- The workspace number you want to change
- The new name of the workspace
Exemple: You had a workspace named "1: Terminal" or even "1" and you want to change it to "1: Code"
rename-i3-workspace 1 Code
You can find the comparaisons between the solutions I did.
- Check the arguments passed to the program
- Add the possibility to rename a workspace to a multi-word name
- Nicer looking codes, using comptime to read the structure instead of raw going after specific chains of character :)
For education purposes, I have also implemented this in Python. You can find it in the other folder.