DEV Community

sium_hossain
sium_hossain

Posted on

1

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 studio.sh file to set it as desktop app icon.
When you download android studio from Android studio official site and after extract you will get studio.sh executable file. And you can run android studio from terminal by



./studio.sh


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]
Version=1.0
Type=Application
Name=Android Studio
Exec= sh /path/to/studio.sh #path to your studio.sh file mine is /usr/local/android-studio/bin/studio.sh
Icon=/usr/local/android-studio/bin/studio.png #path to your application icon 
Categories=Development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-android-studio
Name[en_GB]=android-studio.desktop


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 😎

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Sentry blog image

The countdown to March 31 is on.

Make the switch from app center suck less with Sentry.

Read more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay