I am new to Linux and this may sound very dumb but I need to make a desktop icon on centos 7 but I don't know how to do it. I tried googling but I can't even find Launcher. Need help
4 Answers
Use of GNOME3 is assumed.
Using a preexisting shortcut
Reference: How to add desktop shortcut icons in RHEL7 ? (2015) (registration required)
Click on
Home
directory on desktop. The nautilus (file browser) window will open.Click the
Computer
tab in the left navigation panel, go to/usr/share/applications
. All the applications icons will appear in the right browser window.Right click desired icon (Firefox, Contacts etc)
After right clicking the icon, select
Copy To
in the context menu. A Select Destination will open up, pick Desktop folder in the left navigation panel (via left-click)Left-click the
Select
button on the bottom right of the window.
Using a symlink
This is an alternate technique that works as long as you know the path to the executable.
Simply create a symlink on the desktop pointing to the executable. For example:
$ ln -sv /full/path/to/executable ~/Desktop/
‘/home/someuser/Desktop/executable’ -> ‘/full/path/to/executable’
$ ll ~/Desktop/
total 0
lrwxrwxrwx. 1 someuser someuser 57 Oct 1 19:31 executable -> /full/path/to/executable
The above step can actually also be done graphically using the Files
application. To do it this way, browse to the executable, right-click, and select Make Link
. Drag and drop the newly created link to the Desktop.
Next, graphically customize the shortcut's icon. It is not clear where this customization is stored since the shortcut is still just a symlink.
-
What if I need to run a program with an additional argument? e.g., /usr/local/MATLAB/bin/matlab -desktop ... Do i just have to create a small script that calls the program with the argument, and link to the script instead?– reas0nCommented Apr 26, 2017 at 14:43
-
2Answered my own question: Go to /usr/share/applications and create a .desktop file there. You can copy one of the existing files and just replace the relevant information the program, including the command with arguments. Then you can make a copy of that to your desktop. This is the proper way, I believe.– reas0nCommented Apr 26, 2017 at 15:51
Try this for creating shortcut/launcher on GNOME 3 Desktop
Note: I'm using CentOS 7 running GNOME 3 Desktop.
- Open a terminal
- Go to Desktop directory (
/home/$yourname/Desktop/
) - Create a desktop file (
touch appName.desktop
) - Open the file and add the following content to the file (
vi appName.desktop
)
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Exec=/home/$YOURNAME/apps/scilab-6.0.0/bin/scilab
Name=scilab
Comment=
Icon=/home/$YOURNAME/apps/scilab-6.0.0/share/icons/hicolor/32x3/apps/scilab.png
Comment[en_US.utf8]=
Name[en_US]=Scilab 6.0
- Change file permission to 755 (
chmod 755 appName.desktop
)
Variable value:
Terminal=<This is value is either true or false (depending on your application requirement). If it's a terminal dependency application, then true else false.>
Exec=path to your application executable
Icon=path to your app icon file (.png or .svg)
Name[en_US]=The name that will display on your desktop under the icon
In this document Click means click twice
Click on Home directory on desktop. The file browser window will open.
Click the Computer tab in the left navigation panel, go to /usr/share/applications. All the applications icons will appear in the right browser window.
Right click desired icon (Firefox, Contacts, Terminal etc)
After right clicking the icon, select Copy To in the menu.
Select Copy Destination will open up, pick Home folder in the left navigation panel (via left-click)
Pick Desktop from the right hand panel - double click
Left-click the Select button on the top right of the window.
Shortcuts to panel do not work in CentOS 7.
As a work round I have been able to get something working but not ideal. Gnome 3 seems to be a backward step from user customability point of view.
Install gnome-shell-frippery
which modies ~/.local and
you can configure using Utilities -> Tweak Took
from "Applications Menu".
Also you can copy /usr/share/applications
.desktop file and copy to ~/Desktop
for shortcut
& ~/.local/share/applications
to make it appear in "Applications Menu" for that user only
/usr/share/applications
for system wide in "Applications Menu"
~/.local/share/applications
for local to that user only.
You can also modify *.desktop files in /usr/share/applications
and put in users ~/.Desktop
folder as a desktop shortcut.
Super+D