Hi @rasat
Ah, I see your confusion. I hadn’t given you the specific answer to your question. My apologies. I’d hoped it would have lead you to the answer. If the below is still unclear, let me know and I’ll see if I can draw some diagrams or try a different means of communicating this for you.
Here’s something more to your original request:
DestroyModuleConfig FB-A:*
*FB-A: (1x1, Title "Desk: $[monitor.$[monitor.current].desk]", Id D)
KillModule FvwmButtons FB-A
FvwmButtons FB-A
DestroyModuleConfig FE-E:*
*FE-E: Cmd
*FE-E: new_desk "SendToModule FB-A ChangeButton D Title 'Desk: $$$$[monitor.$[monitor.current].desk]'"
KillModule FvwmEvent FE-E
Module FvwmEvent FE-E
To break this down for you:
*FB-A: (1x1, Title "Desk: $[monitor.$[monitor.current].desk]", Id D)
This creates a button with an Id
of D
, so we can refer to it later on. We also set the initial Title
of the button to be the monitor’s current desk.
*FE-E: new_desk "SendToModule FB-A ChangeButton D Title 'Desk: $$$$[monitor.$[monitor.current].desk]'"
Then, using FvwmEvent, we set up a listener for when we change desk, such that we use the SendToModule
command to reference the FvwmButtons alias we created earlier (FB-A
), issuing the command ChangeButton
. In doing so, we give it the button Id we want (in this case, it’s D
), and issue the further command of Title
, to which we specify the new title string ('Desk: $$$$[monitor.$[monitor.current].desk]'
).
As an addendum, the reason we specify $$$$
here is so that the parsing rules in fvwm dont’ expand the string too early, and only do so when the desk changes, and not before.
I hope this helps.