LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   one way to do custom menus without kmenuedit (https://www.linuxquestions.org/questions/linux-software-2/one-way-to-do-custom-menus-without-kmenuedit-149159/)

anura 02-22-2004 11:33 AM

one way to do custom menus without kmenuedit
 
It is quite possible that there are better ways to create custom menus,
but I was not able to find any howto.

So I tried and finally found out how to create custom menus for single users
without kmenuedit on SuSE 9.0, KDE 3.1. If you have trouble with kmenuedit you
might try the following:

Place your links (.desktop files) in
/home/username/.local/share/applications

Place your menus (.directory files) in
/home/username/.local/share/desktop-directories

Edit your file applications-kmenuedit.menu:
/home/username/.config/menus/applications-kmenuedit.menu

Press CTRL + ALT + Backspace to log in again and see the changes.


Here is an example which is working for me:
************************************

link files:
/home/username/.local/share/applications/Gimp.desktop
/home/username/.local/share/applications/Sodipodi.desktop
/home/username/.local/share/applications/evolution.desktop
/home/username/.local/share/applications/KMail.desktop


menu files:
/home/username/.local/share/desktop-directories/NameOfMainMenu.directory
/home/username/.local/share/desktop-directories/Graphics.directory
/home/username/.local/share/desktop-directories/Email.directory



Content of the file /home/username/.config/menus/applications-kmenuedit.menu
(Sorry, I canīt include the full "<!DOCTYPE ..." here as new forum members are not
allowed to post urls... So please see the first line in your file applications-kmenuedit.menu):

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" ... >

<Menu>


<Menu>
<Name>NameOfMainMenu</Name>
<Directory>NameOfMainMenu.directory</Directory>
</Menu>

<Menu>
<Name>Graphics</Name>
<Directory>Graphics.directory</Directory>
<Include>
<Filename>Gimp.desktop</Filename>
<Filename>Sodipodi.desktop</Filename>
</Include>
</Menu>

<Menu>
<Name>Email</Name>
<Directory>Email.directory</Directory>
<Include>
<Filename>evolution.desktop</Filename>
<Filename>KMail.desktop</Filename>
</Include>
</Menu>



<Move>
<Old>Graphics</Old>
<New>NameOfMainMenu/Graphics</New>
</Move>


<Move>
<Old>Email</Old>
<New>NameOfMainMenu/Email</New>
</Move>


</Menu>


***************************************************************

With the sections <Move>...</Move> you create the submenus
"Graphics" and "Email" in the custom menu "NameOfMainMenu".

If you donīt include these sections you will create single independent menus.

If you want to include an already existing menu as a submenu
of your custom menu, just add a <Move>...</Move> section with
the name of the existing menu.



If you already tried to make your menu with kmenuedit and did not succeed,
there is a lot of code in applications-kmenuedit.menu and a lot of .desktop
and .directory files which you may wish to delete before creating your custom
menu manually:

1. delete all .desktop files in /home/username/.local/share/applications
2. delete all .directory files in /home/username/.local/share/desktop-directories
3. delete the text in /home/username/.config/menus/applications-kmenuedit.menu
4. press CTRL + ALT + Backspace to log in again and activate the changes.
5. start creating your custom menu as described above


This is just what I found out. Hope it is of use for someone ;-)

Larry Staberg 04-14-2004 10:03 AM

Have you in your wanderings found a forum that specializes in kde administratio?

I would like to customize the files in /usr/share/??? to affect all users both for the K-menu and for the Panel..

With your effort I'm trying to look at similar files in /usr/share but it has been difficult..

Things have changed a great deal from the 2.x to 3.2 versions as to where you put system wide configuration..

Compounding this is the fact that I'm not sure who's designing these locations, Redhat or KDE....

I've yet to find a 'how to config kde'...

Logomachist 05-06-2014 04:32 PM

Are menu files still in $HOME ?
 
Is this info still current? I don't have /home/username/.local/share/applications or /home/username/.local/share/desktop-directories directories. I do however have a lot of .directory files in /usr/share/desktop-directories/ and .desktop files in /usr/share/applications/ and /usr/share/kde4/ (and subdirectories).

Have the files been moved to a new directory? Or are these other files used for something else? Know of any online references explaining how the menu files are parsed?

ETA: I just found http://standards.freedesktop.org/men...-spec-1.0.html which explains how the menu files are parsed.

John VV 05-06-2014 05:33 PM

you do know that his thread is 10 YEARS old
a lot of things have changed in 10 YEARS
for one thing the desktop went from KDE3 to KDE4
and moved off QT 2 and 3 to QT 4 and 5

also you DO have this folder
"/home/username/.local":
just replace "username" with YOUR USERS NAME


All times are GMT -5. The time now is 10:33 PM.