Skip to content

Instantly share code, notes, and snippets.

@54keesh
Last active September 9, 2025 10:00
Show Gist options
  • Save 54keesh/e8bd7a3af9812f5ec42c0235b72c754b to your computer and use it in GitHub Desktop.
Save 54keesh/e8bd7a3af9812f5ec42c0235b72c754b to your computer and use it in GitHub Desktop.
Script to create desktop icons from standalone app images
!# /bin/bash
cp app.AppImage ~/Applications/app.appimage
// following is the .desktop file to be placed in ~/.local/share/applications/
/** app.desktop **/
[Desktop Entry]
Name=file name
Exec=/home/username/Applications/app.appimage
Terminal=false
Type=Application
Icon=icon
// here hicolor is icon theme
// Afterwards place an icon of app in ~/local/share/icons/hicolor/64x64/apps/icon.png
// or simply add icon path directly in Icon
After that run following command
#! /bin/bash
update-desktop-database ~/.local/share/applications
@54keesh
Copy link
Author

54keesh commented Sep 9, 2025

Currently in ubuntu 22.04

IMPORTANT

A desktop icon wont be created if Exec key has invalid file path that doesnt exist. Under the hood it validates that.

No need to run update-desktop-database as soon as the file is copied in the respective directory itll be shown afterwards on desktop

@54keesh
Copy link
Author

54keesh commented Sep 9, 2025

desktop-file-install file.desktop command adds a given .desktop file to /usr/share/applications and will be consequently shown in start menu as well.

Above command validates the .desktop file and afterwards automatically runs update-desktop-database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment