LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-07-2009, 12:21 PM   #1
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Rep: Reputation: 56
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
 
Old 01-07-2009, 12:28 PM   #2
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Just add the entry to /usr/share/applications
 
Old 01-08-2009, 11:24 AM   #3
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
[solved]

heck? THAT easy?
would not have expected it!!

thanx

Markus
 
Old 02-04-2009, 10:21 AM   #4
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
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
 
Old 02-04-2009, 01:52 PM   #5
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by browny_amiga View Post
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.
 
Old 02-04-2009, 05:55 PM   #6
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
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
 
Old 02-05-2009, 04:01 AM   #7
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
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.
 
Old 02-08-2009, 03:05 PM   #8
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
Cool

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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to Add new Menu Entry crash_override_me Debian 3 05-19-2008 12:43 PM
How to add KDE menu to DroplineGNOME menu! Fluxx Slackware 0 11-22-2005 03:01 PM
Add KDE menu in Gnome start menu melinda_sayang Slackware 2 03-06-2004 05:26 AM
How do i add or remove buttons from the KDE 'start' menu? m15a4 Linux - Software 5 12-22-2003 04:12 AM
How to add KDE menu items to Gnome menu... QtCoder Linux - General 4 10-05-2003 01:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration