`xdg-open` on Linux is fucked up. The thing never works properly for me.

In the attached screenshot below, you can see that `feh` is the default application for opening jpg files, however, it always opens the file in the browser. It doesn't work for any other filetypes as well. It's just messed up.

By the way, I tried to do some debugging on the line number xdg-open reports. It calls this bash line: `"$command_exec" "$@"`, however, when I echo the command, it prints nothing. So this means it can't find the program to open the file with and, at the same time, it reports that the program is set as you can see in the screenshot!!

  • 3
    I just did some more tinkering.
    Apparently, xdg-open doesn't handle aliased commands. I have `feh` aliased as `feh -F`. So whenever xdg-open uses the `which` command, the output is `feh: aliased to feh -F`, and clearly, this isn't a valid program name, so that's why it won't work 🤦.
  • 0
    At least in Debian I read that xdg-open was deprecated and now longer in development. I could be wrong tho
  • 1
    Take a look at the arch wiki. There are some good alternatives that replace xdg-open. I'm guessing they are available for other distros too.
Your Job Suck?
Get a Better Job
Add Comment