Subject: FVWM: query pager labels?

From: Victor Eijkhout <[email-masked]>
Date: Fri, 25 Oct 2002 11:05:32 -0400

Can I retrieve the value of a desktop label in the pager?

Right now I'm setting the values from a form, and saving them 
additionally in an environment variable:

*NameDesk: Text "Name this desktop:"
*NameDesk: Line expand
*NameDesk: Input deskname 20 ""
*NameDesk: Button quit "OK" ^M
*NameDesk: Command SetEnv label_$d '$(deskname)'
*NameDesk: Command PipeRead `echo "*FvwmPager: Label $d '$(deskname)'"`

so that I can write them out:

AddToFunc ExitFunction
+ I Exec for i in `awk -v n=$[FVWM_N_DESKS] \
              'BEGIN { for (i=0; i<=n; i++) { print i } }' ` ; \
     do eval echo "*FvwmPager: Label $$i \\\"\$label_$$i\\\"" ; \
        eval echo "SetEnv label_$$i \\\"\$label_$$i\\\"" ; \
     done > $[HOME]/.fvwm/labels

(wanna guess how long it took me to find the right combination of 
eval,$$,\\\ &c?)

but obviously I don't like double bookkeeping. I would like that 
first eval line above to write out the pager label, as opposed to an 
environment variable that I hope has the right value.
-- 
Victor Eijkhout <[email-masked]>
tel: 865 974 9308 (W), 865 673 6998 (H), 865 974 8296 (F)
http://www.cs.utk.edu/~eijkhout/
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Fri, 25 Oct 2002 11:56:25 -0400

> environment variable that I hope has the right value.

Perhaps Mikhael  would  be interested in  adding  the equivalent of an
M_CONFIG_INFO to FvwmPerl.

Why don't you just have FvwmForm update the .fvwm/labels file?

-- 
Dan Espen                           E-mail: [email-masked]

---

From: Victor Eijkhout <[email-masked]>
Date: Fri, 25 Oct 2002 13:16:23 -0400

>M_CONFIG_INFO to FvwmPerl.

And don't rest until fvwm is Turing-equivalent :-)

>Why don't you just have FvwmForm update the .fvwm/labels file?

I guess that would be possible. Then the file would keep growing with 
everytime I name a desktop, but I guess I can find an opportunity to 
curtail it.
-- 
Victor Eijkhout <[email-masked]>
tel: 865 974 9308 (W), 865 673 6998 (H), 865 974 8296 (F)
http://www.cs.utk.edu/~eijkhout/
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Fri, 25 Oct 2002 13:28:50 -0400

> And don't rest until fvwm is Turing-equivalent :-)

It isn't now?

> everytime I name a desktop, but I guess I can find an opportunity to 

Use sed/awk/perl to replace the label, don't add to the end.

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 25 Oct 2002 17:30:51 +0000

> M_CONFIG_INFO to FvwmPerl.

I am not sure. I think reading configuration of others is like reading
passwords of others. :) I only planned to add support for its own module
configuration. Let's be confidential and solve it the right way.

> Why don't you just have FvwmForm update the .fvwm/labels file?

There is much easier solution in 2.5.x and I posted it several times.

Just don't use "*FvwmPager: Label" starting from 2.5.x, use a new
DesktopName command. It was invented exactly for the purpose of switching
from the FvwmPager's private data to a globally accessible data, desk
names is something that many modules and WindowList may be interested in.
Then you may read $[desk.name<n>] anywhere. Thanks to Olivier.

  DesktopName 2 MyDeskNumber2
  ...
  Exec exec xmessage "name of the desk number 2 is $[desk.name2]"

Just try currently not to use spaces in the name, because I want
to require quotes if there are spaces, currently quotes are ignored here.

Regards,
Mikhael.

---

From: Dan Espen <[email-masked]>
Date: Fri, 25 Oct 2002 13:49:11 -0400

> configuration. Let's be confidential and solve it the right way.

It's not someone else's configuration.
Modules might sometimes need to read other modules configurations.

> to require quotes if there are spaces, currently quotes are ignored here.

DeskTopName works better, but the issue is saving the name for
the next session.  Is it saved by the session manager feature?
The man page doesn't say.

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 25 Oct 2002 18:14:45 +0000

> The man page doesn't say.

I didn't cover the session issue, just answered the original question
"Can I retrieve the value of a desktop label in the pager?"

If the labels should be restored on the next session, then yes, they
should be stored in ~/.fvwm/desktop-names or similar.

Regards,
Mikhael.

---

From: Olivier Chapuis <[email-masked]>
Date: Sat, 26 Oct 2002 00:06:13 +0200

> should be stored in ~/.fvwm/desktop-names or similar.

Yes we should put this on the todo list.
Olivier