Jump to content

fixing WindowMaker menu

Recommended Posts

It's on Mandriva 2007 which is using the new freedesktop standard XDG menu. The problem is WindowMaker does not support it. To workaround it XDG is able to generate a menu in WM readable format. Of course all the items in this menu are in the big menu there is nothing which would only show up under WM. I'd like to workaround it.

This is the /etc/menu.d/WindowMaker script which generates the WindowMaker menu from XDG menu:

if [ "$USER_MENU" = "1" ]; then

echo -e '/* Automatically generated file by /etc/menu.d/WindoMaker. Do not edit */\n\n#include "wmmacros"\n' > $OUTPUTDIR/menu 

if [ "$VERBOSE" = "1" ]; then
echo "writing to $OUTPUTDIR/menu"
/usr/bin/xdg_menu --verbose --format WindowMaker --charset UTF-8 >> $OUTPUTDIR/menu 
/usr/bin/xdg_menu --format WindowMaker --charset UTF-8 >> $OUTPUTDIR/menu 2> /dev/null

As you can see it's very simple., and it generates a menu file like this:

/* Automatically generated file by /etc/menu.d/WindoMaker. Do not edit */


#include "wmmacros"


"Mandriva Linux" MENU


#include "user.menu"


"Internet" MENU

"Azonnali üzenetküldés (IM)" MENU

"Kopete" EXEC kopete -caption "Kopete"

"Azonnali üzenetküldés (IM)" END

"E-mail" MENU

"KDE csoportmunka-varázsló" EXEC groupwarewizard

"KMail" EXEC kontact-kmail.sh

"KSig" EXEC ksig -caption "KSig"

"Kontact" EXEC kontact

"E-mail" END

"Egyéb" MENU

"KNewsTicker" EXEC appletproxy knewsticker.desktop

"Egyéb" END

"Fájlátvitel" MENU

"KGet" EXEC kget -caption "KGet"

"Fájlátvitel" END

"Hírek" MENU

"Akregator" EXEC kontact-akregator.sh -caption "Akregator"

"KNode" EXEC kontact-knode.sh -caption "KNode"

"Hírek" END

"Távoli hozzáférés" MENU

"Krdc" EXEC krdc -caption "Krdc"

"Távoli hozzáférés" END

"Videokonferencia" MENU

"Ekiga telefonszoftver" EXEC soundwrapper /usr/bin/ekiga

"Videokonferencia" END

"Webböngész?k" MENU

"Konqueror" EXEC kfmclient openProfile webbrowsing

"Mozilla Firefox" EXEC /usr/bin/mozilla-firefox

"Webböngész?k" END

"Webszerkeszt?k" MENU

"Nvu" EXEC /usr/bin/nvu

"OpenOffice.org Writer/Web" EXEC ooweb2.0

"Webszerkeszt?k" END

"Internet" END




"Mandriva Linux" END

I cut out the most but it's still understandable I think.

Now as you can see every submenu is between "Something MENU" and "Something END" bracketts like the whole menu is between "Mandriva Linux MENU" and "Mandriva Linux END". So if I want to modify the generated menu I have to put the new lines before the "Mandriva Linux END" line. How do I do that from a script? I thought for example after genarating the menu deleting the last line and adding new entries by using "echo "blah blah" >>menu file". So how can I delete the last line of a text file from a bash script? Or does anybody have a better idea to solve this?

Link to comment
Share on other sites

  • 3 months later...
Guest John Duchek

what I am trying to to is import the kde menu into window maker format. I followed your directions and got a file that looked alot like what I wanted, but wasn't recognized by window maker.



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...