DEV Community


Posted on

Creating a desktop shortcut for a shell script (Ex:How to add Android Studio to the launcher)

You can set desktop icon in your machine of any kind of .sh executable file. Here we can use android studio file to set it as desktop app icon.
When you download android studio from Android studio official site and after extract you will get executable file. And you can run android studio from terminal by

Enter fullscreen mode Exit fullscreen mode

Install android studio

But who used terminal to run a application, let's set a desktop icon

Create a studio.desktop file in desktop location or you can set name as your wish like - name.desktop

[Desktop Entry]
Name=Android Studio
Exec= sh /path/to/ #path to your file mine is /usr/local/android-studio/bin/
Icon=/usr/local/android-studio/bin/studio.png #path to your application icon 
Enter fullscreen mode Exit fullscreen mode

Paste that piece of code into studio.desktop file

Save it...

Then go to your desktop, and you will see the icon of your application. But you will see an error something like launch your application. So you have to give permission to launch that application. Right-click your mouse on that icon, and you will get an option

Voila... now we can run our script as a desktop icon 😎

Top comments (0)