I want to call a file-option menu from within a directory browser, for each file which is in a given directrory. The file option menu has entries such as ‘view’, ‘edit’, etc. Atm I’m trying to do this using fvwm-menu-directory, but I can’t get it working, as when I use the --command-file option, I do not seem to be able to either remember the file from which the menu is called, or echo it to some file, so I can use the content later using cat.
Here is more or less what I have:
You were so close, too. You can make use of the “%f” variable to ‘fvwm-menu-directory’ to do this. This appends the full path plus filename. In this way, I then used a function to build the menu. A bit different to what you were doing, but it demonstrates the purpose. The following illustrate the two changes to your code, as above:
DestroyFunc FuncFvwmMenuDirectory
AddToFunc FuncFvwmMenuDirectory
+ I PipeRead 'fvwm-menu-directory -d '$0' --title '%d' --command-file "Function fooMenu '%f'"
DestroyFunc fooMenu
AddToFunc fooMenu
+ I DestroyMenu recreate MenuFileOptions
+ I AddToMenu MenuFileOptions Edit Exec rxvt -e vi $0
+ I AddToMenu MenuFileOptions View Exec rxvt -e less $0
+ I Popup MenuFileOptions
Thanks for the reply.
It does indeed do what I asked for, but the problem is (same problem I experienced before when using fvwm-command in a bash script) is that the file actually needs to be clicked for the menu to show up.
In that way the rest of the menu dissapears.
I would like it to be that when going over the file without clicking the menu shows up (so like a directory).
You know if this is possible, as it seemes that only the ‘–command-file "popup…’ supports this?
Okay, now I know at least that there is no straight solution.
I changed the method invoking a file-browser in Fvwm-script and calling from there editor and others (just modified a script from fvwm-themes)