Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I save links as files, rather the using bookmarks. I just drag the URL field from Firefox onto my desktop/folder.

Recently these stopped opening in Firefox, and started "opening" in Gedit. Even in Gedit, the file errors. The only way I can open these to even see the link is by using vim, having navigated to the file from the terminal.

There are a number of threads with similar problems, to solutions to which I have tried to no avail. <THIS THREAD> describes exactly my problem, but no solution is posted.

Example URL File Contents:

[Desktop Entry]
Encoding=UTF-8
Name=Link to Google
Type=Link
URL=http://www.google.com
Icon=text-html

Contents of my ~/.local/share/applications/mimeapps.list:

[Added Associations]
application/x-rpm=ubuntu-software-center.desktop;
x-scheme-handler/mailto=thunderbird.desktop;
message/rfc822=thunderbird.desktop;
application/x-extension-eml=thunderbird.desktop;
inode/directory=vlc.desktop;
application/pdf=inkscape.desktop;kde4-okularApplication_pdf.desktop;
text/x-python=vim.desktop;gedit.desktop;
application/pgp-keys=libreoffice-calc.desktop;
image/x-hdr=gedit.desktop;
text/plain=libreoffice-calc.desktop;
audio/x-vorbis+ogg=totem.desktop;
application/octet-stream=gedit.desktop;
x-scheme-handler/ftp=firefox.desktop;
x-scheme-handler/chrome=firefox.desktop;
text/html=firefox.desktop;
application/x-extension-htm=firefox.desktop;
application/x-extension-html=firefox.desktop;
application/x-extension-shtml=firefox.desktop;
application/xhtml+xml=firefox.desktop;
application/x-extension-xhtml=firefox.desktop;
application/x-extension-xht=firefox.desktop;

[Default Applications]
x-scheme-handler/mailto=thunderbird.desktop
message/rfc822=thunderbird.desktop
application/x-extension-eml=thunderbird.desktop
application/pdf=kde4-okularApplication_pdf.desktop
text/html=firefox.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/about=chromium-browser.desktop
x-scheme-handler/unknown=chromium-browser.desktop
audio/x-vorbis+ogg=totem.desktop
x-scheme-handler/ftp=firefox.desktop
x-scheme-handler/chrome=firefox.desktop
application/x-extension-htm=firefox.desktop
application/x-extension-html=firefox.desktop
application/x-extension-shtml=firefox.desktop
application/xhtml+xml=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-extension-xht=firefox.desktop

And here is a screen-shot of Gedit trying to open these: Gedit trying to open these:

Any help super appreciated, as this is driving me crazy.

share|improve this question
    
Post the link into the question. Someone else can add it as a picture ;) –  Rinzwind Nov 20 '12 at 15:28
add comment

2 Answers 2

up vote 1 down vote accepted

It appears I borked things when following <a tutorial> to set things up so I could just right-click files to open them in vim.

The two resources I found most helpful to figure this out were:

There was clearly nothing wrong with the url files, as navigating to their parent directory and running the following opened them in just fine:

# firefox url-name.desktop

This indicated that there was an issue with the Exec line for getting run properly. I then discovered that I had a symbolic link to my firefox.desktop file by running the following in my user specific directory:

# ls -l ~/.local/share/applications/

As described in the second link, mimeapps.list is a user-specific list of default applications to be used to open various mime-types (i.e. file types).

I renamed this file to archive it, and then I created a sym-link to the defaults.list:

# ln -s /local/share/applications/defaults.list/ ~/.local/share/applications/defaults.list

Restarting , and everything worked! Phew. Hopefully, this helps somebody. Now to see what I did wrong with that vim tutorial...

share|improve this answer
add comment

Don't know if that's the problem, but it looks like a wrong URL in your example:

URL=http://www.google.html

The top-level domain (.com, .de, …) is missing.

Maybe the gedit error could be a result of this, because of the /, if gedit might think that it's a local file path (instead of a Internet URL)? Doesn't seem plausible, though (why does gedit even bother? Shouldn't it simply show the text file content anyway?). Is gedit trying to navigate to the URL?

share|improve this answer
    
Thanks unor. I did a manual edit of a link to make it more generic, and missed this. I solved my question, but was required to wait to post the answer as a new member. –  shootingstars Nov 21 '12 at 10:02
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.