Skip to content

Instantly share code, notes, and snippets.

@thieunguyenhung
Last active January 13, 2019 03:09
Show Gist options
  • Save thieunguyenhung/14c7024246312791c697e9c58096b8e3 to your computer and use it in GitHub Desktop.
Save thieunguyenhung/14c7024246312791c697e9c58096b8e3 to your computer and use it in GitHub Desktop.
Example to create a custom .desktop file in Linux

How to create a custom .desktop file in Linux

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Sublime Text 3
Comment=Sublime Text 3
Exec=/opt/sublime_text_3/sublime_text
Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png
Terminal=false

To run Sublime Text 3 with root permission, change Exec parametter as below, where 123456 is your root password

Exec=gnome-terminal -e "bash -c 'sudo -S <<< 123456 /opt/sublime_text_3/sublime_text && exit;$SHELL'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment