Overview
Sometimes in linux, we don’t get a proper installer for an application. To run such application, we typically have to execute a shell script in the application bundle. In this post, we will see how to create a desktop shortcut in Ubuntu 20.04
The need for a desktop shortcut.
Navigating to applications’ binary everytime we need to run it can be a bit annoying, as well as time consuming. While there are some enthusiats who love this, there is also a section of users that wishes to have a shortcut so that, executing your favourite program is just a matter of clicking an icon. Afterall, why compromise accessibility just because you are on linux? 🙂
Creating desktop shortcut – tools vs manual method
While there are many useful tools like Gnome tweak tool , we will follow the manual route. We will create a something.desktop file in /usr/share/applications/. The application for which we will be creating this shortcut for is a famous IDE called PHPStorm and its trial version can be downloaded here
TLDR
Open up your terminal and create a file in /usr/share/applications/.
|
|
Download and extract the package. Move the extracted folder to /opt/
|
|
Create a file phpstorm.desktop in /usr/share/applications/
|
|
Paste following code in the file
|
|
Now when you open your applications window, you should see an entry for PHPStorm as well.
You can now simply click this icon to launch your application, instead of manually executing shell script each time :).
Following above steps will create a desktop shortcut for any such application, however running application from shortcut created using this method can add a duplicate icon in the launcher. To prevent this, we need to add one more attribute to our phpstorm.desktop file, but first, we need to get the value of this attribute. To do this,
- Launch the application i.e. Phpstorm.
- type following in terminal
|
|
After running above command, the cursor should turn to crosshair. Now, click on the application for which you are creating the shortcut, Phpstorm in this case. In the terminal you should see something like
|
|
Copy the value in quotes – “jetbrains-phpstorm”. In phpstorm.desktop file, add following
|
|
Finally, the contents of the phpstorm.desktop file are as follows
|
|
Restart the application, now you should not see duplicate icon in launcher.