On Tue, 29 Sep 2009 16:39:23 +0200
"Carlos R. Mafra" <[email protected]> wrote:

> 
> > What about Freedesktop menu support in wmaker?
> 
> I am happy with 'genmenu' script. And I remember having seen some
> scripts converting KDE menus to wmaker, so is there a need to
> bother about this?
>  
> > http://standards.freedesktop.org/menu-spec/latest/ - Desktop Menu
> > Specification.
> > http://standards.freedesktop.org/desktop-entry-spec/latest/ -
> > Desktop Entry Specification.
> > 
> > It is quite simple.
> 
> Then it should be simple to make a patch too.
> Do you have an idea about how to do it? :-)
> 
> 
>  
> 
>  
> 
> 
> -- 
> To unsubscribe, send mail to [email protected].

I did some work awhile ago on this. I rewrote the old kde menu generator in 
bash and added another utility.
I never settled on what might be the best design ideas. What I mean is that 
it's easy enough to create a generator which will show the whole *.desktop 
database, but I figure that most users would want to be able to *limit* the 
menu entries. So I wrote the tools so that they would create a separate tree of 
*.desktop files in the users HOME directory. Then, the menu-item-generator 
works from this database. The trouble with this is that it adds bloat to the 
HOME dir and doesn't allow for updating menu items which are later installed to 
the main database in /usr/share/applications.

I'm attaching the files for what it is worth and would appreciate any feedback 
or fixes which address the issues above. Note that I purposely eliminated the 
need for awk/perl as used by the former tools. It does make the tools slower, 
but brings no extra depends other than bash.

wm-update-deskto-menus is the tool which creates or duplicates the database 
tree with *.desktop files. It should be run first, and can also be setup to run 
each time the user logs in (by placing the command in the 'autostart' script)
wm-gen-desktop-menu is the tool which creates the menu for you on-the-fly. To 
use it:
You can add a line this to your WindowMaker WMRootMenu file:
("Desktop Applications", OPEN_MENU, "|| /usr/bin/wm-gen-desktop-menu 
~/GNUstep/DesktopMenus"),
Or you can use the WPrefs application to add a 'Generated Submenu' with this 
command:
/usr/bin/wm-gen-desktop-menu ~/GNUstep/DesktopMenus
--note assuming that wm-gen-desktop-menu is installed to /usr/bin

I've also attached another tool I use to generate menus on-the-fly as another 
example of what can be done.
wm-gen-appdir-menu creates menu items for a directory full of ROX-Filer 
AppDirs. AppDirs are self-conatined applications or wrappers which fit 
everything into a special 'executable' directory. With ROX-Filer they are 
treated so transparently just by clicking on them. But, they can be used under 
other environments by simply executing the AppRun script found in each AppDir. 
wm-gen-appdir-menu creates a menu item for each AppDir which executes the 
AppRun script.

While we're on the subject, I'll also attach another 
menu-generator(resolution.sh)  written by Piter Punk. resolution.sh can be used 
by
creating a menu entry for a ''Program Generated Submenu' using the 
resolution.sh command. The menu item then looks like this:
("Set Resolution", OPEN_MENU, "|| /usr/bin/resolution.sh"),
What the tool does is use xrandr to read the possible screen resolutions and 
create a submenu which lets you simply click on the desired resolution to 
change your screen resolution. It requires awk to work.

Hope these help...
Gilbert Ashley

Attachment: wm-update-desktop-menus
Description: Binary data

Attachment: wm-gen-desktop-menu
Description: Binary data

Attachment: wm-gen-appdir-menu
Description: Binary data

Attachment: resolution.sh
Description: Binary data

Reply via email to