Subject: FVWM: fvwm-menu-directory sample

From: "Jules Alberts" <[email-masked]>
Date: Wed, 20 Aug 2003 13:22:59 +0200

Can anybody tell me if there are fvwm-menu-directory online somewhere? 
I love this feature but even with the manpage I have some questions... 
Mainly about --icon-file and to have a directory menu as top level 
menu. TIA!
--
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: Dominik Vogt <[email-masked]>
Date: Wed, 20 Aug 2003 13:41:15 +0200

> Mainly about --icon-file and to have a directory menu as top level 

Have you tried

  $ man fvwm-menu-directory

?

Bye

Dominik ^_^  ^_^

---

From: "Jules Alberts" <[email-masked]>
Date: Wed, 20 Aug 2003 14:32:17 +0200

>   $ man fvwm-menu-directory

Sure, maybe it's better if I mention concretely what I want. I have a 
menu that works like this:

My first question is how to add directory entries at toplevel of the 
menu. With this setup:

  Key Super_L A A Popup menu_root Root 8 1

  AddToFunc FuncFvwmMenuDirectory$
  + I PipeRead "fvwm-menu-directory \\$
    --title '' \\$
    --icon-dir /home/blah/data/fvwm/resource/folder-menu.xpm \\$
    --exec-app '^exec' \\$
    -d '$0'"

  AddToMenu menu_root MissingSubmenuFunction FuncFvwmMenuDirectory$
  + "menu"  Popup /home/blah/data/fvwm/testmenu

I get a submenu in my menu with the contents of the testmenu directory.
But I want the contents of the testmenu directory to be in the menu, 
not in a submenu.

Another question: how can I prevent my submenus from having a title? 
The best I came up with is --title '' which is kind of ugly.

The last question is about icons. This is from the manpage:

--icon-title icon menu title icon, default is no
--icon-dir icon menu dir icon, default is no
--icon-file icon menu file icon, default is no
--icon-app icon menu application icon, default is no
--wm-icons define icon names suitable for use with wm-icons package.
  Currently this is equivalent to: --icon-title menu/folder-open.xpm
  --icon-item menu/file.xpm --icon-dir menu/folder.xpm --icon-app
  menu/utility.xpm.

--wm-icons looks nice but I'm not sure what it does... The way I 
interpret is, I should be able to do this: there is a shortcut to gvim 
in my menu-dir. Now, if I put a file gvim.xpm in the menu-dir, it 
should appear as an icon before the gvim entry. Alas, it doesn't, the 
xpm appears as a file. How do the icons work?

TIA!

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 20 Aug 2003 19:38:44 +0300

> But I want the contents of the testmenu directory to be in the menu, 

The way fvwm-menu-directory works is: one invocation builds one menu for
one directory. By default this menu is destroyed when you pop down the
menu. This way you always get the up-to-date listing in the menu and not
the one that is several months old (assuming you run fvwm for this long).

> The best I came up with is --title '' which is kind of ugly.

The title is always added. Are you sure you really don't want any title,
how would you distinguish between different listings then? You may use
some desciptive title: --title "My important files".

If you really don't like the title, do this:

  AddToFunc FuncFvwmMenuDirectory
  + I PipeRead `fvwm-menu-directory -d '$0' | grep -v '$0" ' | grep -v Nop`

> xpm appears as a file. How do the icons work?

Nope, --wm-icons was not designed to work like this, you are not supposed
to put any icons anywhere, it just assumes that you have wm-icons package
installed. With this options the installed icons will be automatically
used and the actual icon theme seen in menus is configurable by wm-icons.
You just need "ImagePath $HOME/.wm-icons:/usr/local/share/icons/wm-icons:+",
like explained in the wm-icons.sf.net documentation.

Apart of the usage of the word "no" instead of "nope", I think the man
page explains that you may assign 4 icons for different file types. Your
approach to handle some files differently by using them as icons of the
previous file seems very strange to me. Especially when we speak about
random directories (like /tmp or $HOME/.fvwm) and the file order is
configurable. I am not against such features, but this one is not well
defined. Please also keep in mind that this script does not currently
manages icons itself, it is fvwm that searches the icons in ImagePath.

If I understand correctly, you want to prepare the application hierarhies
to be used in menus. This is what another script fvwm-menu-desktop was
designed for, so try it. You should prepare .desktop files similarly to
GNOME and KDE that define the icon and the name for every application.
fvwm-menu-directory is more for arbitrary (non prepared) directories.

Regards,
Mikhael.

---

From: "Jules Alberts" <[email-masked]>
Date: Thu, 21 Aug 2003 10:01:23 +0200

> On 20 Aug 2003 14:32:17 +0200, Jules Alberts wrote:

<snip>

Hello Mikhael, thanks for answering!

> > directory. But I want the contents of the testmenu directory to be in
> > the menu, not in a submenu.
> 

OK. I guess I will have to add submenus to my root menu one by one.

> some desciptive title: --title "My important files".

The tree-like look of menu-submenu-submenu allows me to allways see 
where I'm coming from. A submenu title is in this case redundant. And 
it also costs time. I call the menu with a keyboard shortcut. When I 
[arrow] into the submenu of my choice, I have to do an extra [down-
arrow] to get onto something useful. That's ons keystroke extra for 
each time I enter a submenu. And when I press enter by mistake on a 
submenu name, I get an xterm in the dir of that submenu.

No, I would really like to get rid of the titles :-)

>   + I PipeRead `fvwm-menu-directory -d '$0' | grep -v '$0" ' | grep -v

I (partly) works. I have two more questions though. I tried your 
PipeRead and it works fine, but when I combine it with the commands I 
already have (--icon-dir blah.xpm --exec-app '^exec') the menus don't 
work anymore.

If I use your piperead as-is, all my menu-entries (which are softlinks 
to programs) are opened with vim. Also, sub-sub-menus (since 
FvwmMenuDirectory works recursively -which is really nice-) still get a 
title.

> Nope, --wm-icons was not designed to work like this, you are not
> supposed to put any icons anywhere, it just assumes that you have
> wm-icons package installed. With this options the installed icons will
> be automatically used and the actual icon theme seen in menus is
> configurable by wm-icons. You just need "ImagePath
> $HOME/.wm-icons:/usr/local/share/icons/wm-icons:+", like explained in
> the wm-icons.sf.net documentation.
> 
> If I understand correctly, you want to prepare the application
> hierarhies to be used in menus. This is what another script
> fvwm-menu-desktop was designed for, so try it. You should prepare
> .desktop files similarly to GNOME and KDE that define the icon and the
> name for every application. fvwm-menu-directory is more for arbitrary
> (non prepared) directories.

OK, I will have a look at menu-desktop and wm-icons. Thanks again.

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 21 Aug 2003 12:47:51 +0300

> No, I would really like to get rid of the titles :-)

Ok, in the next versions (2.4.17 and 2.5.8) two things will be added. If
you specify --command-title "" then the title item is not choosable like
any normal menu Title; and if you specify --title "" then the title is
removed completely. Any of these should solve your keyboard navigation.

> FvwmMenuDirectory works recursively -which is really nice-) still get a 

It should work, I can't say why it does not work for you without seeing
the exact configuration. Try to run this PipeRead command from the shell.

Regards,
Mikhael.

---

From: "Jules Alberts" <[email-masked]>
Date: Thu, 21 Aug 2003 12:20:36 +0200

> removed completely. Any of these should solve your keyboard navigation.

Wow, I don't know what to say... Thanks!! I think more people will like 
this option.

> > FvwmMenuDirectory works recursively -which is really nice-) still get
> > a title.
> 

OK, I will experiment with it, see what it does.