I want to make a .desktop
file like described here.
[Desktop Entry]
Name=Sublime Text 2
GenericName=Sublime Text 2
Comment=Edit text files
Exec=/home/user/opt/sublime/Sublime Text 2/sublime_text %U
However, running that from Nautilus's context menu using Open with this gives me
Could not find '/home/user/opt/sublime/Sublime'
So I tried
Exec="/home/user/opt/sublime/Sublime Text 2/sublime_text" %U
and got
Text ended before matching quote was found for ". (The text was '"/home/user/opt/sublime/Sublime')
What is the correct way to escape spaces in the Exec
line of .desktop
files?
Text ended just after a '\' character. (The text was '/home/user/opt/sublime/Sublime\')
– nh2 Sep 18 '12 at 21:11GNOME nautilus 3.4.2
on 12.04. – nh2 Sep 19 '12 at 12:45Icon=
property actually requires passing spaces as is, without any quotation or backslashes. – Hi-Angel Sep 18 '22 at 01:35