Script: How do I print the workspace number?
I occasionally want to rename my workspaces and refer to them by their numbers. So I switched from workspace
to workspace number
and renamed them like so:
1
renamed to 1: www
2
renamed to 2: music
, etc
as per the user guide. Furthermore, following the suggestion from section 6.5.2 of the user guide, I added the following line in my configuration file:
bindsym $mod+n exec i3-input -F 'rename workspace to %s' -P 'New name: '
However, I would like to avoid typing "1: www"
if I could just type www
and automatically have the workspace number assigned. In particular, I need a variable, say $WSNUM
such that I could write the line like so:
bindsym $mod+n exec i3-input -F 'rename workspace to "$WSNUM: %s"' -P 'New name: '
Is there such a variable? How should I write this line?
Oops. I think this is a duplicate of https://faq.i3wm.org/question/451/dynamically-change-workspace-name-with-ease/ I will check it out more thoroughly and will close this question if it is so. EDIT: No, it's not exactly duplicate, plus the script in that question does not work for me.
It seems the solution is in section 3.3 of http://i3wm.org/docs/ipc.html#_workspaces_reply (due to my karma I cannot post links). Apparently the workspace number is part of the reply for the workspaces of the IPC interface. I am trying to read through but I'm totally lost, don't know how to use it..