LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to add e menu entry to KDE start menu over CLI (https://www.linuxquestions.org/questions/linux-general-1/how-to-add-e-menu-entry-to-kde-start-menu-over-cli-695617/)

browny_amiga 01-07-2009 12:21 PM

How to add e menu entry to KDE start menu over CLI
 
Hi there

I have an own program that I have created a install package for (.deb). I want to create a menu entry in KDE when it is installed. So far all I could find was a GUI Menu Editor for KDE, which does not work for me obviously. Anyone know how you script adding a menu entry?

Cheers

Markus

SqdnGuns 01-07-2009 12:28 PM

Just add the entry to /usr/share/applications

browny_amiga 01-08-2009 11:24 AM

[solved]
 
heck? THAT easy?
would not have expected it!!

thanx

Markus

browny_amiga 02-04-2009 10:21 AM

not so easy
 
Hi

I tried it and it is not that easy really. The entries that I create with the menu editor (as a template) get created in the local dir of the user and do not show up for other users therefore.
When I copy these .desktop entries into /usr/share/applications they don't show up in other peoples menus.
I want that the programs I install are accessible by all users.

Markus

arizonagroovejet 02-04-2009 01:52 PM

Quote:

Originally Posted by browny_amiga (Post 3431998)
Hi
When I copy these .desktop entries into /usr/share/applications they don't show up in other peoples menus.

You check the permissions on the files you put in /usr/share/applications?
Can you post the contents of one of your .desktop files?
Are you using KDE 3 or KDE 4? Though the method for both is the same I think.

browny_amiga 02-04-2009 05:55 PM

I suspected the permissions to be the problem at the beginning too, so I changed everthing to read (user / group / other), in line with all the other files in the dir.

here one .desktop file:

brownyworld.desktop (which is really only a directory, a subcategory, under which you can fit menu entries:


# cat /usr/share/applications/Brownyworld.desktop
[Desktop Entry]
Comment=
Exec[$e]=
GenericName=Brownyworld Tools
Icon=access2
Name=Brownyworld
Path[$e]=
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=

-----------------------
and the other one (the real menu entry to launch a program)

cat /usr/share/applications/Frostybaby\ unstable.desktop
[Desktop Entry]
Comment=
Exec[$e]=python /usr/share/frostybaby-unstable/frostybaby.py
GenericName=
Icon=amor
Name=Frostybaby unstable
Path[$e]=
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=


So far I cannot find out what is going wrong, maybe you got an idea.

Markus

arizonagroovejet 02-05-2009 04:01 AM

Well under KDE 3 /usr/share/applications/Frostybaby\ unstable.desktop works fine for me. It shows up in the K-Menu under Applications. If you want it to show somewhere else you need to specify a category. If it doesn't show up for you then try logging out and in again or restart the kicker with

Code:

$ dcop kicker kicker restart
brownyworld.desktop - well if that's supposed to define a new directory level on the K Menu then for starters the filename needs to be brownyworld.directory and you don't need an Exec line. Also you need a .menu file somewhere. On my SLED 10 systems at work I have

Code:

$  cat /etc/xdg/menus/custom.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
 <Menu>
  <Name>Place</Name>
  <Directory>place.directory</Directory>
  <Include>
  <Category>Place</Category>
  </Include>
  <Layout>
  <Merge type="menus" />
  <Menuname>Applications</Menuname>
  <Merge type="files" />
  <Filename>foo.desktop</Filename>
  <Filename>boo.desktop</Filename>
  <Filename>moo.desktop</Filename>
  </Layout>
  <Menu>
  <Name>Applications</Name>
  <Directory>place-applications.directory</Directory>
  <Include>
  <Category>Place-Applications</Category>
  </Include>
  <Layout>
    <Merge type="all" />
    <Menuname>Bah</Menuname>
    <Menuname>Mah</Menuname>
  </Layout>
  <Menu>
    <Name>Maths</Name>
    <Directory>place-maths.directory</Directory>
    <Include>
    <Category>place-Maths</Category>
    </Include>
  </Menu>
  <Menu>
    <Name>Stats</Name>
    <Directory>place-stats.directory</Directory>
    <Include>
    <Category>Place-Stats</Category>
    </Include>
  </Menu>
  </Menu>
 </Menu>

Note the Category tags.

Code:

$ cat /usr/share/desktop-directories/places.directory
[Desktop Entry]
Type=Directory
Name=Place
Icon=/usr/share/icons/place.png

Code:

$ cat /usr/share/applications/foo.desktop
[Desktop Entry]
Categories=place-Maths
Comment=
Comment[en_GB]=
Encoding=UTF-8
Exec=blahblahblah
GenericName=
GenericName[en_GB]=
Icon=/usr/share/icons/foo.png
MimeType=
Name=Foo
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID

All of the above applies to KDE 3. If you're using KDE 4 the dcop command is not relevant and other aspects may be different.

browny_amiga 02-08-2009 03:05 PM

Yes, this is KDE3.5.
On Debian though and I don't have a applications menu. And so far I am not seeing any menu entries that I put into /usr/share/applications...How does this work with the menu entries in /etc/xgd/ ? is there any tutorial or info how everything is laid-out and connected with eachother? Wiki or anything?
I see that the files in xgd are written in XML, do you know any editor on Linux that can display XML in a structured view, meaning that you can edit the fields and show it hierachical, instead of plain text?

So far I came up empty handed.

thanx

Markus


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