Subject: FVWM: current desktop using FvwmCommand?

From: "Riswick, J.G.A. van" <[email-masked]>
Date: Sat, 15 Dec 2001 23:28:32 +0100

HI

I'd like to implement a 'goto desktop' menu which 
shows a few desktop numbers (as menu items), and a '*' in 
front of the current desktop number. Upon choosing a number,
the current desktop is changed to that number.

The question is, how to get the asterisk (*) in front
of the current desktop number. Is it possible to retreive 
this using FvwmCommand? 

best regards

jos
--
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: Mikhael Goikhman <[email-masked]>
Date: Sat, 15 Dec 2001 23:58:52 +0000

> of the current desktop number. Is it possible to retreive 

Use this piece of code (4 lines) that builds and shows requested menu.

  AddToFunc ShowMyDeskMenu
  + I DestroyMenu MyDeskMenu
  + I PipeRead `for i in 0 1 2 3; do echo -n 'AddToMenu MyDeskMenu "';
[ $$d = ${i} ] && echo -n "**"; echo \\ ${i}'" GotoDesk '${i}; done
                                       ^
                                       |__ real TAB for better alignment
  + I Menu MyDeskMenu

Double dollar is to expand desk at run time, not at func definition time.
Double star is to escape star in AddToMenu.
Double slash is to escape TAB (one for FVWM, another for /bin/sh), so TAB
is passed to echo.
${i} ensures FVWM does not expands var, but /bin/sh does.

Regards,
Mikhael.