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
OUTPUTDIR=$HOME/GNUstep/Library/WindowMaker/
else
OUTPUTDIR=/usr/share/WindowMaker
fi

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 
else
/usr/bin/xdg_menu --format WindowMaker --charset UTF-8 >> $OUTPUTDIR/menu 2> /dev/null
fi

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.

 

John

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...