Tools
Tools: How to Configure Desktop Launchers on Ubuntu 24 with Standard Icons
2026-02-22
0 views
admin
What is a .desktop file? ## Where to put launcher files ## Minimum launcher content ## The Icon= key ## The Exec= key and variables ## Optional keys worth using ## Example: custom script launcher on the Desktop ## Example: website link launcher ## Troubleshooting ## Useful links ## References Desktop launchers on Ubuntu 24 (and most Linux desktops) are defined by .desktop files: small, text-based config files that describe an application or link. Once you know where to put them and which keys to set-such as Icon= and Exec=-you can add custom launchers to your Desktop or application menu. This guide covers how to configure them and where to find standard icons on Ubuntu for the Icon= field. A .desktop file is a freedesktop.org Desktop Entry: a UTF-8 text file with a .desktop extension. It has a [Desktop Entry] group and key-value pairs. Three types are defined: Application (launch a program), Link (open a URL), and Directory (folder in menus). For launchers you care about Application and optionally Link. The format is used by GNOME (Ubuntu default), KDE, XFCE, and others. System-wide entries are typically in /usr/share/applications/; for Ubuntu package management and installs, new .desktop files there appear in the application menu. User-defined launchers belong in ~/.local/share/applications/ (menu) or ~/Desktop so they show as icons on the desktop. To get a launcher on the desktop on Ubuntu 24, put the .desktop file in ~/Desktop. To have it only in the application menu, put it in ~/.local/share/applications/. You can use the same file in both places (e.g. copy or symlink) if you want it in menu and on desktop. For an Application launcher you need: Optional but useful: Icon=, Comment= (tooltip), Terminal= (run in terminal), Path= (working directory), TryExec= (check if app is installed). All keys are case-sensitive. Example minimal launcher: Save as e.g. ~/Desktop/my-script.desktop. On some desktops you may need to mark it executable: chmod +x ~/Desktop/my-script.desktop. If the icon is missing, the desktop falls back to a default; the launcher still runs if Exec= is correct. Exec= holds the command to run. You can pass arguments and use spec-defined variables: Example: Exec=myeditor %f opens the selected file in myeditor. For a simple launcher with no file/URL argument, a plain command is enough: Exec=firefox or Exec=/usr/bin/gnome-terminal. If the program must run in a terminal (e.g. a script that needs a TTY), set Terminal=true and use Exec= with the command: Exec=/home/user/scripts/backup.sh. Save as ~/Desktop/daily-backup.desktop, run chmod +x ~/Desktop/daily-backup.desktop if your desktop requires it, and the icon should appear on the desktop. Double-clicking runs the script in a terminal. For a launcher that opens a URL, use Type=Link and URL=: Same rules for Name and Icon; the desktop will open URL with the default browser or handler. After editing .desktop files, the menu cache may need to refresh; logging out and back in or running update-desktop-database (if available) can apply changes. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse CODE_BLOCK:
[Desktop Entry]
Type=Application
Name=My Script
Exec=/home/user/bin/my-script.sh Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
[Desktop Entry]
Type=Application
Name=My Script
Exec=/home/user/bin/my-script.sh CODE_BLOCK:
[Desktop Entry]
Type=Application
Name=My Script
Exec=/home/user/bin/my-script.sh CODE_BLOCK:
[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 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
[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 CODE_BLOCK:
[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 CODE_BLOCK:
[Desktop Entry]
Type=Link
Name=Project Wiki
Comment=Open project wiki in browser
URL=https://wiki.example.com/project
Icon=web-browser Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
[Desktop Entry]
Type=Link
Name=Project Wiki
Comment=Open project wiki in browser
URL=https://wiki.example.com/project
Icon=web-browser CODE_BLOCK:
[Desktop Entry]
Type=Link
Name=Project Wiki
Comment=Open project wiki in browser
URL=https://wiki.example.com/project
Icon=web-browser - Type=Application
- Name= - label shown in menus and under the icon
- Exec= - command to run (program path or name in PATH) - Theme icon name (no path) - e.g. Icon=utilities-terminal or Icon=firefox. The desktop looks up the icon in the current theme under /usr/share/icons/ (e.g. Yaru, Adwaita, hicolor). This is the preferred option when a suitable icon exists in the standard icon collection.
- Absolute path - e.g. Icon=/usr/share/pixmaps/ubuntu-logo.svg or Icon=/home/user/.local/share/icons/myapp.png. Use for custom icons (PNG, SVG, or XPM). - Comment= - Short description; often shown as tooltip.
- GenericName= - Generic type of app (e.g. "Web Browser").
- Categories= - Menu categories (only relevant for entries in applications/); see Desktop Menu Specification.
- TryExec= - Path to executable; if missing or not executable, the entry can be hidden from menus (useful for optional apps).
- Path= - Working directory for the application.
- StartupNotify= / StartupWMClass= - For better taskbar/launcher behavior when the app starts. - Launcher doesn’t run - Check Exec= (full path or command in PATH). For scripts, ensure they are executable and that Terminal=true if they need a terminal. Checking your Ubuntu version and desktop (GNOME vs KDE) can help when behavior differs.
- Wrong or missing icon - Use a known theme icon name (e.g. from /usr/share/icons/Yaru/ or standard icons) or an absolute path to a valid image file.
- Not visible on desktop - Confirm the file is in ~/Desktop, has a .desktop extension, and (on some setups) is executable. For file manager differences (Nautilus vs Nemo, etc.), desktop handling is usually the same for .desktop files in ~/Desktop.
- Not in application menu - Put the file in ~/.local/share/applications/. If a system entry with the same filename exists, the user file takes precedence. You can install and manage packages to add or remove system .desktop files. - Check Linux Ubuntu Version
- Context menu in File managers for Ubuntu 24.04 - Nautilus vs Nemo vs Dolphin vs Caja
- How to Install Ubuntu 24.04 & useful tools
- GPU monitoring applications in Linux / Ubuntu
- Kubuntu vs KDE Neon: A Technical Deep Dive
- Ubuntu Keyboard Shortcuts: A Little Cheatsheet
- Ubuntu Package Management: APT and dpkg Cheatsheet
- How to Change a Static IP Address in Ubuntu Server - Desktop Entry Specification (freedesktop.org)
- Desktop Entry Specification - Exec key and variables
- Icon Theme Specification (freedesktop.org)
- Desktop Menu Specification (freedesktop.org)
how-totutorialguidedev.toaimllinuxubuntuserverdatabase