.desktop file that you are currently running
- It is probably in a system location, so copy it to a user location
- Modify the file contents
The normal way to create icons for GUI apps on Linux is to create
.desktop files. These are files describing the shell-style command used to start the program, any additional parameters (such as command line arguments and environment variables specific to the program) as well as some metadata (such as a description, localized names, the actual icon of the program) that graphical desktop environments can use to display icons for the program in their GUI.
Generally speaking, if you create a correct
.desktop file in the correct location, the program will show up in the various GUI menus, and when you click it it will run whatever you put under
Exec. The easiest way to create a "correct" file is to copy an existing working one and modify it. There are many "locations" that these files can go in, but the important distinction is system vs. user files (aka "entries"):
- System entries will affect all users on that computer. You will typically need
sudo to edit them. They are usually put there by the package manager, so if you edit the system file and also later update the package and the upstream modifies the
.desktop file, there will be a conflict between changes you made and the new version from upstream. Your package manager will have to resolve this conflict somehow, but it's always much easier to avoid the conflict to begin with and instead edit the user file.
- User entries will be under you home directory (
~) in locations such as
~/.local/share/applications/. If the same program has both a system and a user entry, the user entry will override the system one. Packages do not normally put stuff in
~/.local/share/applications (although the programs themselves might, when run) so this is a safer place to put modified files. You can start by copying the system file to the user location and modifying from there. User files will only apply to you, other users will not see entries you put there.
For details, see: