Choose style:

Author Topic: How do I add a new menu item? (SOLVED)  (Read 3830 times)

0 Members and 1 Guest are viewing this topic.

Offline nberidze

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 5
How do I add a new menu item? (SOLVED)
« on: May 25, 2014, 01:40:38 pm »
Have used Peppermint for a few weeks now, and overall impressed by how user friendly Linux has become. Generally, though, where's the documentation? For example, where do I go to read how to for example add a menu item? (I have installed a program, and want to include it in the menu.)
« Last Edit: May 27, 2014, 04:37:11 pm by nberidze »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25500
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: How do I add a new menu item?
« Reply #1 on: May 25, 2014, 01:47:25 pm »
Normally installing a GUI application will automagically add it to the menu's

Occasionally though, the applications .desktop file is badly written (with only gnome/KDE in mind)

So which application have you installed ?

and if you go to
/usr/share/applications
is there a launcher for it in there ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline nberidze

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 5
Re: How do I add a new menu item?
« Reply #2 on: May 25, 2014, 06:12:27 pm »
Let's say I install a program that is not prepared for this, it's graphical but the authors have only made a script to launch it, not prepared it for LXDE, KDE or Gnome or anything. I have to make a new menu entry for it.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25500
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: How do I add a new menu item?
« Reply #3 on: May 25, 2014, 06:44:20 pm »
What is the application called ?

What does it do ?

What command starts the application ? .. ie. path to the executable script you mention

Where in the menu do you want it ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline nberidze

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 5
Re: How do I add a new menu item?
« Reply #4 on: May 26, 2014, 11:07:03 am »
What is the application called ?

What does it do ?

What command starts the application ? .. ie. path to the executable script you mention

Where in the menu do you want it ?

Isn't there some standard way to add menu items? Let's say I want to add a program to Accessories and it is started by running a script under /usr/bin/

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25500
  • Karma: 2807
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: How do I add a new menu item?
« Reply #5 on: May 26, 2014, 11:23:03 am »
Sure there is a "standard" way:
http://standards.freedesktop.org/desktop-entry-spec/latest/

But it's usually easier to show by example ;)

Anyway .. go to
/usr/share/applications (for system wide .desktop launchers)
and/or
~/.local/share/applications (for user specific .desktop launchers)

In those directories you'll find the .desktop files for all your installed GUI apps.

Right-click on one, and select open with > text editor

and by comparing a few and where they are displayed in the menu you should be able to figure out how to create your own .dektop file .. containing any name, icon, command, menu position, etc. you like



[EDIT]

In your example .. lets say you wanted the menu entry to be called "MyApp" .. and the executable script was at /usr/bin/myapp .. and you want to use the default cog icon.

You'd create a .desktop file called say myapp.desktop

make it's contents read
Code: [Select]
[Desktop Entry]
Type=Application
Name=MyApp
Comment=This is what MyApp does
Exec=/usr/bin/myapp
Icon=default
Terminal=false
Categories=Utility;
then save that file to
/usr/share/applications
(if you want it to be displayed in ALL users menus)

or
~/.local/share/applications
(if you want it to only be displayed in the current users menus)

Then restart lxpanel:
Code: [Select]
lxpanelctl restart
to reload the menu.
(or log off/on)
« Last Edit: May 26, 2014, 12:03:17 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline nberidze

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 5
Re: How do I add a new menu item?
« Reply #6 on: May 26, 2014, 01:15:19 pm »
Thank you very much, also for the added explanation.  :) I added the Tor browser bundle, and used Firefox's .desktop file as model. I click and it starts, but I obviously need to read more on freedesktop.org to understand the various instructions in such a startup file. So I have to go "under the hood" a little (car comparison). Maybe there should be a short "Menu How-To" somewhere in Peppermint's documentation, so others can find this easily? Or include a link to a user friendly manual?