create shortcut on desktop

How to Easily Create Desktop Shortcuts on Raspberry Pi OS?

If you are used to other systems where creating desktop shortcuts is a breeze, this process might be a mystery to you after switching to Raspberry Pi OS. Don’t worry it isn’t very complicated, just follow the steps I will share with you in this tutorial.

If an app shortcut is available in the main menu, it’s possible to create a shortcut on the desktop with a drag & drop. If it’s a custom application not in the main menu, the only way will be to create the shortcut file (.desktop) with a text editor.

The first solution is pretty intuitive, whereas the second is almost impossible to remember. I’ll show you both in this article, with a tip to make the second easier.

If you’re looking to quickly progress on Raspberry Pi, you can check out my e-book here. It’s a 30-day challenge where you learn one new thing every day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.

Option 1: Drag & drop

Creating a desktop shortcut for programs available in the main menu is straightforward: a drag & drop of the icon to the desktop will create the shortcut for you.

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

I don’t think this is available in older versions, so you might need to either upgrade (procedure here) or read the next section if it doesn’t work. But on the latest versions of Raspberry Pi OS, you can follow this easy process:

  • The application should already be installed (here is how) and listed in the main menu.
  • Open the main menu, and find the corresponding application.
  • Drag and drop the icon on the desktop.
    You can also do a right-click on it and choose “Add to Desktop”.
  • You should see an icon like this added on the desktop:
  • You can rename the shortcut if you want.
    Hit “F2” and type the new name in the window that shows up.

That’s it! Not so complicated, isn’t it?
You can now launch the app by double-clicking on it.

Join Our Community!

Connect, learn, and grow with other Raspberry Pi enthusiasts. Support RaspberryTips and enjoy an ad-free reading experience. Get exclusive monthly video tutorials and many other benefits.

Learn more

Option 2: Shortcuts for custom programs

This was the easy way. But, if you are here, it’s probably because you didn’t find a way for this process to work. For example, if you installed a program that isn’t automatically added to the main menu, or even have to run a script or command in a terminal. I will explain all of this now.

Are you a bit lost in the Linux command line? Check this article first for the most important commands to remember and a free downloadable cheat sheet so you can have the commands at your fingertips.

Add it to the main menu

I will take the example of PyCharm, a famous programming tool that ranked well in my best text editors here.
When you download it on the website, you get an archive file (.tar.gz).
There is a script to run to open the program after extracting the files, but it doesn’t automatically create a main menu entry (yes, there is a way, but that’s not the point today).

Here are the steps to create a desktop shortcut for an app that is not listed in the main menu:

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now
  • Open the main menu, and go to Preferences > Main Menu Editor.
  • This tool allows you to choose which shortcut you want in the main menu.
    Just use the checkbox to enable or disable anything.
  • But you can also add new items:
    • Pick a category (“Programming” in my example).
    • Click on “New Item” on the right.
    • A window like this shows up:

      Fill the form with at least the name and the executable path (in the command field).
      You can click on the image icon on the left to use a custom icon.
    • In my example with PyCharm, it will be something like that:
    • Once done, click on “OK” twice to save the changes.
  • The shortcut should now be available in the main menu.

Create the desktop shortcut

From there, you can just follow the drag & drop method I previously shared. This will create the new desktop shortcut.

In fact, this is just an easy way to generate the file we’ll create manually in the last solution (without having to remember the file content).

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

Option 3: Create a custom script

The PyCharm example

In the previous method, we have seen how to create a “.desktop” file on our Desktop to get a shortcut to open an application.

With this third method, we’ll basically create the “.desktop” file manually.
Here is what it should look like:

[Desktop Entry]
Comment=Run PyCharm
Terminal=false
Name=Pycharm
Exec=/home/pat/Downloads/pycharm-community/bin/pycharm.sh
Type=Application
Icon=/home/pat/Downloads/pycharm-community/bin/pycharm.png

So, basically, you can copy this example, change the parameters to fit the application you want to run, and it should work.

Create your script and shortcut

I’ll show you a complete example to illustrate this manual method.
Let’s say I want to have a shortcut on my desktop to run htop.
Here is how to do this:

  • Create a new file on your desktop, with a .desktop extension.
    You can do this with the GUI (Right-click > New file) or with nano:
    nano /home/desktop/myshortcut.desktop
  • Paste these lines in it:
    [Desktop Entry]
    Comment=Monitor Pi Usage
    Terminal=true
    Name=Htop
    Exec=htop
    Type=Application
    Icon=/usr/share/pixmaps/htop.png

That’s it, it should now work directly.
If you want to run a custom script or command, you might need to run it in a terminal, by editing the “Exec” value like this:
lxterminal -e <your_command>
For example:
Exec=lxterminal -e /home/pat/myscript.sh

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

If you are looking for exclusive tutorials, I post a new course each month, available for premium members only. Join the community to get access to all of them right now!

Desktop entry main options

Right before we finish, here’s a table with the most common keys you can use to create the perfect desktop shortcut:

KeyDescriptionValues
NameThe name of the shortcut.Ex: “My Shortcut”
CommentThe tooltip (doesn’t work on Desktop I think).Ex: “My App Description”
ExecProgram to execute.Ex: “/usr/bin/app” or command
IconThe path to the icon to use for the shortcut./path/to/icon.ext
TypeThe type of desktop entry (as listed previously).Application, Link or Directory
TerminalOnly for type “Application”. true or false
URLOnly for type “Link”.https//domain.com
PathOnly for type “Application”. If you need to run it in a specific folder.Ex: “/home/pat/myapp”
Desktop entries keys

Here is a link to the complete documentation if you need more details (it’s for GNOME, but it’s similar on any desktop environment).

Whenever you’re ready, here are other ways I can help you:

The RaspberryTips Community: If you want to hang out with me and other Raspberry Pi fans, you can join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.

Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.

The Raspberry Pi Bootcamp: Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.

Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.

You can also find all my recommendations for tools and hardware on this page.

Similar Posts