0

I'm having problems creating a shortcut file to webpages using Type=Link in a .desktop file, on Lubuntu 20.04

Problem

When clicking on a .desktop file with content like this ..

[Desktop Entry]
Type=Link
Name=Name of Link Shortcut
URL=https://askubuntu.com

.. I get the following error message:

invalid-desktop-entry-file

What I've tried

  • Making the file executable with sudo chmod a+x [filename] --- result: same issue
  • Adding Version=1.0 or Version=1.1 --- result: same issue
  • Adding Encoding=UTF-8 --- result: same issue
  • Using different values for the URL key --- result: same issue
  • Changing the file suffix to .url --- result: nothing happens when trying to open the file

I've also run desktop-file-validate which does not give any errors or warnings (except when i include the "Encoding" key)

After searching I found this answer but it gives me the same issue that I describe above


My OS is Lubuntu 20.04, but I think I recall having the same problem on Lubuntu 18.04


Specification document for .desktop files: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

1

1 Answer 1

3

The only solution I found is to directly use the .desktop entry as firefox application:

[Desktop Entry]
Type=Application
Name=Open Askbuntu
Exec=firefox https://askubuntu.com

Lxqt seems to take the URL key as a file browser path:

[Desktop Entry]
Type=Link
Name=Open Askbuntu
URL=/home

Opens the file browser at /home path. Must be a bug? Or some obscure misconfiguration.

1
  • 3
    This is the correct solution (or using xdg-open in lieu of firefox) for everything preceeding Groovy, i.e. with libfm-qt < 0.15.0. There was indeed a bug found and fixed. More info and discussion in the commit message as well as the attached issue. As an aside, Bionic, being LXDE and having libfm (not libfm-qt), should not have the same problem.
    – wxl
    Oct 19, 2020 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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