Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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:

  1. Added a new mime type application/vnd.xx by xdg-mime install mytype.xml. Then xdg-mime query filetype <file name> shows that the new mime type is recognized.

  2. 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;
    
  3. I copied this desktop file to ~/Desktop. After I re-login, I saw the shortcut on the desktop and xdg-mime query defualt application/vnd.xx printed out this desktop file.

  4. 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?

share|improve this question
    
I only copied my program "my-app" to /usr/bin. Is it enough? Or I still need some install operation. Nautilus also shows no application selected for the mime type ;-( –  Amanda Mar 11 '11 at 7:18
    
I reformatted your post; if you need to make further changes, you can just edit this post instead of posting a new question –  Michael Mrozek Mar 11 '11 at 7:21
add comment

1 Answer 1

up vote 2 down vote accepted

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 your my-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.

share|improve this answer
    
Great thanks for your suggestion! I moved the my-app.destop to /usr/share/applications. Then it works! –  Amanda Mar 11 '11 at 8:04
    
@Amanda if you find the answer works then please mark it as "accepted", that would help others when they have the same question. –  phunehehe Mar 11 '11 at 10:53
    
How can I mark it as "accepted"? I didn't find a link to follow .Thanks! –  Amanda Mar 21 '11 at 8:36
    
Per the FAQ (link at top and bottom): When you have decided which answer is the most helpful to you, mark it as the accepted answer by clicking on the check box outline to the left of the answer. This lets other people know that you have received a good answer to your question. Doing this is helpful because it shows other people that you’re getting value from the community. (If you don’t do this, people will often politely ask you to go back and accept answers for more of your questions!) –  geekosaur Mar 21 '11 at 15:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.