Questions tagged [xdg-open]

Xdg-open is part of the xdg-utils package. When invoked from the command-line it can open any file in the default application or an url in the default browser.

Xdg itself was an acronym of the X Desktop Group, which is now known as freedesktop.org, which developed a set of standards that are common across different desktop environments such as GNOME, KDE, LXDE and others.

These standards are important as it means xdg-open can be used on any standards compliant Desktop Environment to open a file with the default application. One just needs, for example, to enter:

xdg-open my.pdf

Whichever desktop environment is running, the native opening program, such as gnome-open, will be invoked.

For more information, see the official site.

112 questions
40
votes
3 answers

How do I set a new xdg-open setting?

I want to use xdg-open to open irc:// links, how can I make the required parameter?
Oxwivi
  • 18,499
32
votes
5 answers

How can I set which application is launched by 'xdg-open'?

I have run update-alternatives as well as the GNOME Preferred apps selection thing. And all point to have the Chromium browser as the default. Yet, when I run xdg-open http://askubuntu.com, Firefox is launched! Similarly, Emacs and Bazaar (bzr) also…
Dima
  • 9,955
23
votes
6 answers

How do I open a file from inside a bash script?

Ok, so running gedit myfile.txt works well. But what about opening a file from inside a bash script, using the default desktop app linked to the filetype? I've tried below, which works great when run manually in terminal, but when I put it in a bash…
Industrial
  • 1,748
22
votes
2 answers

How to reset external protocol handler in Chrome?

A while back I selected "Do nothing" when Chrome asked me how to handle a specific url. Now I want Chrome to launch xdg-open, which again can launch the correct application, but I can't figure out how to undo my "Do nothing" selection. Any…
Emil Lunde
  • 631
  • 1
  • 5
  • 10
16
votes
2 answers

In Ubuntu, xdg-open command is not working

I'm new with Ubuntu, and I read in another thread that to open a file in the default editor (gedit for me), I need to run xdg-open, but for some reason, when I run the command xdg-open app.js I'm getting a bash: xdg-open: command not found…
Efi
  • 161
15
votes
7 answers

how to open multiple files with the default program from terminal?

I tried to open all my .mp3 files from a folder using xdg-open but I found out it opens just one! So I searched a little but there was not such a question! I found "evince" but apparently it open text files and gnome-open also opens one file. I…
karo
  • 147
14
votes
1 answer

Where to change how xdg-open opens urls? sync with kde-open?

kde-open "http://askubuntu.com/" is nice, and opens the URL in my webbrowser but xdg-open "http://askubuntu.com/" opens the link in my texteditor :-( I know where I find the file-association in KUbuntu, but as kde-open works, I guess thats not…
Puggan Se
  • 968
  • 1
  • 10
  • 20
12
votes
2 answers

What do these symbols "$@">/dev/null 2>&1" after a command mean?

I've recently found here a solution to my problem, but I can't completely understand what everything in this command means: xdg-open "$@">/dev/null 2>&1
Willi W
  • 167
11
votes
1 answer

xdg-open only opens a new tab in a new Chromium window despite passing it a URL

When I am using xdg-open to open a link in Chromium, it just results in a new Chromium window with only the new tab page, with nothing else. For example, xdg-open 'https://askubuntu.com' will just open a new Chromium window and won't open up…
Léo Lam
  • 1,012
  • 3
  • 12
  • 27
11
votes
1 answer

How to change file association for files opened in Dolphin from command line in GNOME?

I would like to change several default applications for files opened in Dolphin. I know I could do it manually with kcmshell4 filetypes, keditfiletype or however else but is there a way how to change file associations for Dolphin in terminal? Would…
11
votes
2 answers

Xdg-open doesn't do anything, Zoom in Chromium,

I'm running Ubuntu 18.04.4 LTS. As the title says, when prompt to "xdg open" on Zoom (chromium browser), nothing happens and I can't do a conference call. Does anyone know what might be the issue? I've came across this issue in another websites as…
Dinis Rodrigues
  • 211
  • 1
  • 2
  • 6
10
votes
5 answers

Files lens and xdg-open only open nautilus but not the correct applicatiion

since some days my Files lens opens only nautilus but not the correct application which is associated with the file extension. For example, if I choose a PDF file, Nautilus is openend, pointing to the directory there the file is (and the file is…
che---
  • 153
10
votes
4 answers

Opening Links from some applications takes a long time

When I click on links in some applications it can take up to a minute until the open in the browser. This is regardless if the default browser is chrome or firefox. Example applications where opening links is normally fast: within the…
peter
  • 203
9
votes
4 answers

xdg-open stopped working since 16.04 upgrade

xdg-mime query default inode/directory correctly gives me: nemo.desktop like I expect, and want it to. But xdg-open $HOME Gives an error: xdg-mime: mimetype argument missing Try 'xdg-mime --help' for more information. Unescaped left brace in…
beauxq
  • 211
9
votes
1 answer

how to get links from chrome to open in firefox?

Firefox is my default browser but I have to run Chrome to be able to use PWAs (progressive web apps). when I click links in the PWA they always open a Chrome window. I've been playing with appending an ff: to URLs and then having xdg-open handle the…
kinghat
  • 193
1
2 3 4 5 6 7 8