CentOS 7 – Add A Menu Item.
I am kinda stuck. I want to add a menu item and like all previous versions of CentOS I used Alacarte without issue. In C7, it will not allow you to put anything but a one name command. IE, firefox. You can not have something like java -jar /opt/PROG/NAME.jar. It grays out the OK button as soon as you put a space after java.
Note if you edit a menu item that that has a space, it is also grayed out.
Any other way to add one>
Thanks – Doug
6 thoughts on - CentOS 7 – Add A Menu Item.
Put your command into a bash script that’s named something without a space, perhaps?
I don’t have a running CentOS 7 in front of me, so this is an educated guess: Is there a separate line for “parameters” or “arguments”? I recall seeing a form like that, where the command went in one box, and the arguments in a different box. The program put them together to create the complete command line.
Ted Miller
Versions prior to C7 used GNOME 2.x as the default GUI, and Alacarte worked great with that… sounds like C7 has GNOME 3, and the last I
knew Alacarte had not been fully adapted to GNOME 3.
For the record, Gnome 3.0 was released to the public on Wednesday, 6
April 2011 [1]. Current version 3.12 [2]
[1]
https://mail.gnome.org/archives/devel-announce-list/2011-April/msg00004.html)
[2] http://en.wikipedia.org/wiki/GNOME
Hi,
Below is an example of how to do it under c7.
– Create file named as you wish with a ‘.desktop’ extension.
– Insert the text below and edit to your needs.
[Desktop Entry]
Encoding=UTF-8
Name=My Java App GenericName=My Java app Exec=java -jar /path_to/my_java_app.jar Terminal=false Icon=/path_to/my_icon.png Type=Application
– Save file.
– Copy file to:
* ‘/home//.local/share/applications/’
to be local to that user only.
or
* ‘/usr/share/applications’
to be available system wide.
Your app will appear in a new menu group of ‘Other’.
Note: The example is for a java gui app. If a terminal application, change the ‘Terminal’ line rvalue to true.
Regards
Phil
Thanks Phil. That works. Too bad we are taking steps backwards. I am good at cli, but the vast majority is not.