Re: FVWM: form to rename desktop

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Fri, 15 Mar 2002 16:59:41 +0000

On 14 Mar 2002 23:27:58 -0500, Victor Eijkhout wrote:
>
> > > This doesn't work:
> >>
> >> AddToFunc NameThisDesk
> >> + "I" KillModule FvwmForm
> >> + "I" Module FvwmForm NameDesk
> >> DestroyModuleConfig NameDesk: *
> >> *NameDesk: Line left
> >> *NameDesk: Text "Name this desktop:"
> >> *NameDesk: Line expand
> >> *NameDesk: Input deskname 20 ""
> >> *NameDesk: Button quit "OK" ^M
> >> *NameDesk: Command *FvwmPager: Label * $(deskname)
> >>
> >> probably because FvwmPager: Label is a configuration, not a command.
> >>
> >> What's a better way to do it?
> >
> >You might try to restart the Pager
> >Command KillModule FvwmPager
> >Command Module FvwmPager
>
> So I tried
>
> *NameDesk: Button quit "OK" ^M
> *NameDesk: Command *FvwmPager: Label * $(deskname)
> *NameDesk: Command KillModule FvwmPager
> *NameDesk: Command Module FvwmPager
>
> I did that while on Desk #4. It renamed Desk #1 and emptied the pager
> of all other desks.

What do you mean emptied? You should start the pager as: FvwmPager 0 3.

I have no time to investigate this now, but you may consider "Label *"
not working, it always changes the label of the first desk (number 0).

There are more solutions here. You may use $d instead of "*". There is,
hovewer one unfortunate feature, $d is not expanded in module commands
(otherwise this would break backward compatibility in several modules).
So you should fetch it outside of a module config command. Also there
are two module config commands one in another as you see, so you should
escape some dollars.

In 2.4.* try this. I didn't test it because I have no full config.

*NameDesk: Command SetEnv CURRENT_DESK_NUM $d
*NameDesk: Command *FvwmPager: Label $$[CURRENT_DESK_NUM] $(deskname)
*NameDesk: Command KillModule FvwmPager
*NameDesk: Command Module FvwmPager 0 3

In 2.5.* (use 20020301 snapshot if you like) the solution may be much
cleaner, you don't need to restart any module. You should not use
"*FvwmPager: Label", but a new fvwm command "DesktopName num name".
This command affects desktop names in several places, not just FvwmPager.
This DesktopName command, when called, changes the label of all running
pagers automatically without restarting.

*NameDesk: Command SetEnv CURRENT_DESK_NUM $d
*NameDesk: Command DesktopName $$[CURRENT_DESK_NUM] $(deskname)

There is also a solution with PipeRead, but let's stop here.

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Fri Mar 15 2002 - 11:00:15 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:52 BST