Re: FVWM: current desktop using FvwmCommand?

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Sat, 15 Dec 2001 23:58:52 +0000

On 15 Dec 2001 23:28:32 +0100, Riswick, J.G.A. van wrote:
>
> 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?

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.
--
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 Sat Dec 15 2001 - 17:59:17 GMT

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