1

I created a shortcut for sublime text 3 (sublime_text.desktop)[The file with the good looking icon] and this happened,

my shortcut location and my executable location

error message

The code i used in sublime_text.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Sublime Text
Comment=Sophisticated text editor for code, markup and prose
Icon=sublime-text
Exec=./sublime_text
Terminal=true
Categories=Development;IDE;

I've used many similar examples but didnt work(and yes double clicking sublime_text executable works).

2
  • Please try to write the error codes in your question. Some guys like me are not capable to browse in imgur. Feb 7, 2017 at 14:42
  • there are no error codes :/ sorry Feb 7, 2017 at 14:43

1 Answer 1

1

I don't think that this will work:

Exec=./sublime_text

Use full path instead.

Exec=/full/path/to/sublime_text

To make it work with ./sublime_text you need to have .desktop file and executable file in the same current working directory (.)

If yet does not open, then check for permission issues. When you call the .desktop file with a double click or from your DE apps menu then the .desktop file is executed as user.
If the folder you have your executable file is a root folder, execution will fail due to missing priveleges.
Users can not run root progs, unless the permissions have been set to apply such operation (allow execution by others).

12
  • i specifically mentioned that i dont want to use full paths & without ./ it does not work either Feb 7, 2017 at 14:42
  • @surajmandalcell What's wrong with full paths? In order to make ./ to work the .desktop file and the executable file it seems that must be in the same directory, but yet is not 100% sure that will work Feb 7, 2017 at 14:45
  • it didnt :( sorry but i dont know what am i doing wrong Feb 7, 2017 at 14:46
  • @surajmandalcell Check for permissions. If you call the .desktop file from a double click on your desktop or from your DE apps menu then the .desktop file is called as user. if the folder you have your executable is a root folder, will fail due to missing priveleges. Users can not run root progs, unless the permissions have been set to apply such operation. Feb 7, 2017 at 14:49
  • it turns out that when i use "sudo nautilus" and launch my sublime_text.desktop then it works...and it does not work normally :( any help on permission issue?? Feb 7, 2017 at 15:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .