0

I don't have a linux computer currently running, and I don't remember what linux's internet shortcuts look like. I need to know, so I can create one for linux users I'm distributing content for.

What extension does linux's internet shortcut files use? What do their contents look like? Is it similar to Windows or MacOS? Do different linux distributions have different types?

RWDJ
  • 103
  • 3
  • 1
    Maybe [How to create cross-platform Internet shortcut files](https://superuser.com/q/538089/172747) could be useful? – bummi Jan 08 '19 at 20:17
  • @bummi, indeed. I just came across that. I am still curious, though. But, yeah. I'll just use html. – RWDJ Jan 08 '19 at 20:18
  • Note that the cross platform solution of using an HTML file is not exactly reliable. Lots of users disable JavaScript, a non-negligible percentage have automatic redirects disabled in their browsers, and some browser versions don't properly handle the `` tag approach when the file is opened locally. – Austin Hemmelgarn Jan 08 '19 at 20:38

1 Answers1

1

They take one of two forms:

  • An HTML file using either JavaScript or a <meta http-equiv='refresh' /> tag. This is dependent on a lot of factors to work right (not just on Linux, but on all platforms), namely the user has to have the file set up to open in a web browser, and they have to have whichever method you want to use enabled in their browser (users can and do have either or both disabled), and the browser has to honor it properly for file:/// URL's (most will for the JavaScript, but some don't honor the <meta> tag correctly for file:/// URL's).

  • A FreeDesktop.org Desktop Entry file (info on the exact format can be found on the FD.O site). This is the most reliable method on Linux, as i will work out of the box without issue on most distributions, and with minimum work on those it doesn't (namely, you just need to make sure that the user has execute permissions on the file).

A typical link thus looks something like this:

[Desktop Entry]
    Name="example.com"
    Type="Link"
    URL="https://example.com"

The above file will show up with a name of 'example.com' in all major desktop environments and when double clicked will cause https://example.com to be opened in the user's preferred web browser.

Austin Hemmelgarn
  • 8,960
  • 1
  • 19
  • 32