How to Configure Desktop Launchers on Ubuntu 24 with Standard Icons

Published: (February 21, 2026 at 07:21 PM EST)
5 min read
Source: Dev.to

Source: Dev.to

What is a .desktop file?

  • A freedesktop.org Desktop Entry – a UTF‑8 text file with a .desktop extension.
  • Contains a [Desktop Entry] group with key‑value pairs.
  • Three entry types are defined:
TypePurpose
ApplicationLaunch a program
LinkOpen a URL
DirectoryRepresent a folder in menus (rarely used)

For launchers you’ll usually use Application (and optionally Link).

The format is used by GNOME (Ubuntu’s default), KDE, XFCE, and many other desktops.

Where to put .desktop files

LocationPurpose
~/DesktopIcons that appear on the desktop (when this is your XDG_DESKTOP_DIR)
~/.local/share/applications/User‑specific menu entries (overrides system entries with the same name)
/usr/share/applications/System‑wide menu entries (managed by packages; avoid editing manually)
  • Desktop launcher → place the file in ~/Desktop.
  • Menu‑only launcher → place the file in ~/.local/share/applications/.
  • You can copy or symlink the same file to both locations if you want it in the menu and on the desktop.

Required keys for an Application launcher

KeyDescription
Type=ApplicationDeclares the entry as an application launcher
Name=Label shown in menus and under the icon
Exec=Command to run (full path or name in $PATH)
Icon= (optional)Icon to display (see “Icon options” below)
Comment= (optional)Short description / tooltip
Terminal= (optional)true if the command must run inside a terminal
Path= (optional)Working directory for the command
TryExec= (optional)Path to the executable; used to hide the entry if missing
Categories= (optional)Menu categories (relevant for entries in applications/)
StartupNotify= / StartupWMClass= (optional)Improves task‑bar/launcher behavior

All keys are case‑sensitive.

Minimal example

[Desktop Entry]
Type=Application
Name=My Script
Exec=/home/user/bin/my-script.sh

Save as ~/Desktop/my-script.desktop.
On some desktops you must make it executable:

chmod +x ~/Desktop/my-script.desktop

Icon options

FormExampleWhen to use
Theme icon name (no path)Icon=utilities-terminal or Icon=firefoxPreferred when the icon exists in the current icon theme (/usr/share/icons/...)
Absolute pathIcon=/usr/share/pixmaps/ubuntu-logo.svg or Icon=/home/user/.local/share/icons/myapp.pngUse for custom icons (PNG, SVG, XPM)

If the icon cannot be found, the desktop falls back to a default icon, but the launcher will still work.

Exec= syntax and field codes

You can pass arguments and use spec‑defined variables:

VariableMeaning
%fSingle file path (e.g., one selected file)
%FMultiple file paths
%uSingle URL
%UMultiple URLs
%iIcon name from the desktop file (for startup notification)
%cLocalized name
%kPath to the .desktop file

Example: Exec=myeditor %f opens the selected file in myeditor.
For a simple launcher with no arguments, just use a plain command, e.g. Exec=firefox or Exec=/usr/bin/gnome-terminal.

If the program needs a terminal, set Terminal=true and keep the command in Exec=:

Exec=/home/user/scripts/backup.sh
Terminal=true

Full example – Daily backup script

[Desktop Entry]
Type=Application
Name=Daily Backup
Comment=Run backup script
Exec=/home/user/scripts/daily-backup.sh
Icon=utilities-terminal
Terminal=true
Path=/home/user
  • Save as ~/Desktop/daily-backup.desktop
  • Make it executable: chmod +x ~/Desktop/daily-backup.desktop
  • Double‑clicking the icon will run the script in a terminal.
[Desktop Entry]
Type=Link
Name=Project Wiki
Comment=Open project wiki in browser
URL=https://wiki.example.com/project
Icon=web-browser

The desktop will open the URL with the default web browser.

Common troubleshooting

SymptomLikely causeFix
Launcher does not runWrong or missing Exec= (full path or command not in $PATH).Verify the command works in a terminal; for scripts, ensure they are executable and add Terminal=true if needed.
Icon is missingInvalid Icon= value.Use a known theme icon name (check /usr/share/icons/Yaru/ or similar) or an absolute path to a valid image file.
Launcher not visible on desktopFile not in ~/Desktop, missing .desktop extension, or not executable.Move the file to ~/Desktop, rename with .desktop, and run chmod +x.
Launcher not in application menuFile placed in the wrong directory.Put the file in ~/.local/share/applications/. If a system entry with the same name exists, the user file overrides it.
Changes not reflectedMenu cache not refreshed.Log out/in, or run update-desktop-database (if installed).

Additional topics (placeholders for future guides)

  • Checking your Ubuntu version
  • Context‑menu differences in file managers (Nautilus, Nemo, Dolphin, Caja) for Ubuntu 24.04
  • Installing Ubuntu 24.04 & useful tools
  • GPU monitoring applications on Linux/Ubuntu
  • Kubuntu vs. KDE Neon: a technical deep dive
  • Ubuntu keyboard shortcuts cheat‑sheet
  • Ubuntu package management: APT & dpkg cheat‑sheet
  • Changing a static IP address in Ubuntu

(These sections can be expanded into separate articles.)

  • Server
  • Desktop Entry Specification (freedesktop.org)
  • Desktop Entry Specification – Exec key and variables
  • Icon Theme Specification (freedesktop.org)
  • Desktop Menu Specification (freedesktop.org)
0 views
Back to Blog

Related posts

Read more »

Customizing EurKey on Ubuntu

This has been tested in Ubuntu 24.04. When you need to type in different languages, you can configure your OS to handle their respective layouts. Often, when sw...