Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Create Desktop Shortcuts on Raspberry Pi

Desktop shortcuts are a convenient way to quickly access your frequently used applications, files, or scripts. On a Raspberry Pi, which often runs a Linux-based OS like Raspbian (now known as Raspberry Pi OS), creating desktop shortcuts can streamline your workflow and enhance productivity. This article will guide you through the process of creating desktop shortcuts on your Raspberry Pi, ensuring you can quickly launch your favorite applications or scripts with just a click.

Examples:

  1. Creating a Desktop Shortcut for an Application:

    To create a desktop shortcut for an application, you need to create a .desktop file. Here’s how you can do it:

    • Open a terminal on your Raspberry Pi.
    • Navigate to the Desktop directory:
      cd ~/Desktop
    • Create a new .desktop file using a text editor like nano:
      nano MyApp.desktop
    • Add the following content to the file, replacing the placeholders with the appropriate values for your application:
      [Desktop Entry]
      Name=MyApp
      Comment=This is my application
      Exec=/usr/bin/myapp
      Icon=/usr/share/pixmaps/myapp.png
      Terminal=false
      Type=Application
    • Save the file and exit the text editor (for nano, press CTRL+X, then Y, and Enter).

    This will create a desktop shortcut named "MyApp" on your Raspberry Pi’s desktop. Double-clicking this shortcut will launch the application.

  2. Creating a Desktop Shortcut for a Script:

    If you have a script that you frequently run, you can create a desktop shortcut for it as well:

    • Open a terminal and navigate to the Desktop directory:
      cd ~/Desktop
    • Create a new .desktop file:
      nano MyScript.desktop
    • Add the following content, replacing the placeholders with the appropriate values for your script:
      [Desktop Entry]
      Name=MyScript
      Comment=This is my script
      Exec=/home/pi/myscript.sh
      Icon=/usr/share/pixmaps/script.png
      Terminal=true
      Type=Application
    • Save the file and exit the text editor.

    This will create a desktop shortcut named "MyScript" that will execute your script in a terminal window when double-clicked.

  3. Making the Shortcut Executable:

    After creating the .desktop file, you need to make it executable:

    chmod +x ~/Desktop/MyApp.desktop
    chmod +x ~/Desktop/MyScript.desktop

    This step is crucial; otherwise, the shortcut will not work.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.