FVWM: Re: dynamic menus

From: Robert Nation 885-9815 <rnation_at_mansvr.sanders.lockheed.com>
Date: Thu, 14 Dec 95 14:13:30 EST

>Actually, you should be able to do it using a function. Yup - I just
>did the following in my .fvwm2rc:
>
>------------------------------------------------------------
>Mouse 2 R MC DynamicMenu
>
>AddToMenu DMenu "Dynamic Menu" Title
>
>AddToFunc DynamicMenu "I" DestroyMenu "DMenu"
>+ "I" Read .fvwm2rc-dynmenu
>+ "I" Popup DMenu
>------------------------------------------------------------

With a little magic help from sed, someone could turn this into the
often requested "menu that shows all executables in a directory":

In .fvwmrc

AddToMenu DMenu "Programs" Title
Mouse 1 R S DynamicMenu

AddToFunc DynamicMenu "I" DestroyMenu "DMenu"
+ "I" AddToMenu DMenu "Programs" Title
+ "I" exec ls bin >.fvwm2rc-dynmenu; sed -f sesc .fvwm2rc-dynmenu >.fvwm2rc-dynmenu2
+ "I" read .fvwm2rc-dynmenu2
+ "I" Popup DMenu

and the file sesc is a sed script:

h
G
s/ */+ "/
s:\n:" exec bin/:

Cool man! But,
1. It seems pretty useless, unless you've got a bunch of programs
that are graphical and don't need any arguments.
2. I think there's a race condition between doing the exec
and the read. As I recall, "exec" always background tasks, so there's
no way to make sure its done before doing the read.



--
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Thu Dec 14 1995 - 13:13:57 GMT

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