On Ubuntu 10.10, xdg-open
fails to open the file and give me the error:
No application is registered as handling this file
But xdg-mime query defaut ...
succeeds for the mime type. Why?
Here is my process:
-
Added a new mime type
application/vnd.xx
byxdg-mime install mytype.xml
. Thenxdg-mime query filetype <file name>
shows that the new mime type is recognized. -
I wrote my desktop entry file "my-app.desktop" like this:
[Desktop Entry] Name=xxx Comment=xxx Icon= Exec=/usr/bin/my-app %U Terminal=false Type=Application Categories=Utility; MimeType=application/vnd.xx;
-
I copied this desktop file to
~/Desktop
. After I re-login, I saw the shortcut on the desktop andxdg-mime query defualt application/vnd.xx
printed out this desktop file. -
But,
xdg-open <file name>
fails with the error:No application is registered as handling this file
I've installed nautilus. Do I miss something? How do I fix this?
Best Answer
I don't know off the top of my head if this is the cause of your problem, but in general application
*.desktop
files need to be in specific places to be fully recognized. Try moving yourmy-app.desktop
to~/.local/share/applications/my-app.desktop
(create that directory first if needed:mkdir -p ~/.local/share/applications
). If you used a full pathname to the*.desktop
file, change it to just the basename; I don't think pathnames work as expected there.