54

My question is simple. Is there any fast and easy way of creating .desktop files for shortcuts?

For example, I think you can right click and create .desktop shortcuts in Linux Mint.

I already know how to create them from a text editor like this:

[Desktop Entry] Type=Application 
Name=Eclipse Comment=Eclipse IDE
Icon=/home/jahedev/dev/eclipse-std/icon.png
Exec=/home/jahedev/dev/eclipse-std/eclipse
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Eclipse
Name[en_US]=Eclipse

So are there any GUI apps that can do this?

belacqua
  • 23,540

6 Answers6

35

Have a look at my project, Arronax:

launcher creation dialog

It's available as a plugin for Nautilus and as a standalone application.

To install, open a terminal and type:

sudo add-apt-repository ppa:diesch/stable 
sudo apt-get update
sudo apt-get install arronax
nautilus -q
Zanna
  • 72,312
24

You can try alacarte (Main Menu):

Alacarte is an easy-to-use menu editor for GNOME that can add and edit new entries and menus. It works with the freedesktop.org menu specification and should work with any desktop environment that uses the spec.

By default, is not installed. From terminal, you can install it using the following command:

sudo apt-get install alacarte
Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
18

On Ubuntu 12.04 or 14.04 there's gnome-desktop-item-edit which comes as part of the gnome-panel package:

enter image description here

You could integrate this into your file manager with the following script:

#!/bin/bash

gnome-desktop-item-edit --create-new ~/.local/share/applications

Generic installation instructions for Nautilus scripts: How can I install a Nautilus script?

Glutanimate
  • 21,763
12

For the Xfce desktop environment there is exo-desktop-item-edit, it works similar to it's Gnome counterpart:

exo-desktop-item-edit --create-new ~/.local/share/applications

Screenshot

Grumbel
  • 4,879
3

I have always used alacarte to get this done, However it seems that alacarte is no longer functional for me on Ubuntu 23.10+ (crashes/freezes on most of the actions).

I came across a similar tool called MenuLibre which works perfectly to achieve the same. It can be installed using:

sudo apt install menulibre

then it will be available under your Applications with the name "Menu Editor" MenuLibre GUI

Another thing that I noticed on Ubuntu 23.10+ is that the application entries which I created either using Alacarte or MenuLibre show with gray gear icons on my dock when launched.

To solve this, I had to specify the proper Startup WM Class for each entry MenuLibre Advanced settings

Refer to What does the StartupWMClass field of a .desktop file represent? to learn how to obtain the WMClass of any application on both X11 and Wayland

Mario
  • 205
1

For those looking for a minimalistic option, you can take a look at desktop-entry-creator that I created.

s

On Ubuntu you can install it by first installing the dependencies:

sudo apt install python3-dev libcairo2 libcairo-dev python3-cairo libgirepository-1.0-1 libgirepository1.0-dev libcairo-gobject2

and then install the app from PyPI using pip (or your favourite tool):

python3 -m pip install --user desktop-entry-creator

For the first time you can launch it from the CLI by running:

desktop-entry-creator

and for future runs, you can create a desktop file for it from within itself!

Faheel
  • 113