xdg-open is a tool from the FreeDesktop project. xdg-open accepts both filenames and URLs as arguments; when invoked, it will open the given argument in the user's preferred application for handling that file type or URL. xdg-open is desktop-independent.
Questions tagged [xdg-open]
103 questions
55
votes
2 answers
How does the xdg-open command know which application to use to open a file?
I would expect xdg-open command to use the same application that opens when I double-click the file in the default file manager, but this is not always true.
For example my DE is XFCE, my file manager is Thunar and my default picture viewer is…
Ivan
- 17,368
- 35
- 93
- 118
38
votes
2 answers
Create a custom URL Protocol Handler
I would like to register a URL scheme (or protocol) handler for my own custom URL protocol, so that clicking on a link with this custom protocol will execute a command on that URL. Which steps do I need to take to add this handler?
Example: I want…
palswim
- 4,919
- 6
- 37
- 53
34
votes
1 answer
How does xdg-open do its work
According to the man page, xdg-open will open a file using the application the user has configured. But how is that application actually determined? I can see no config files associated with xdg-utils, so where are my settings stored and how can I…
MvG
- 4,361
- 2
- 28
- 42
15
votes
2 answers
Find the default application for a certain extension
Given xdg-open and an extension, is there a way to get the application which xdg-open is set to for that particular extension?
For example given xdg-open and .jpg the result is eog.
sjsam
- 1,576
- 2
- 13
- 22
15
votes
3 answers
Set default xdg-open application to terminal program
Is it possible to use terminal vim with xdg-open?
I don't have a GUI text editor because I only use vim through the terminal. (I don't care very much for gvim either.) Is it possible to tell xdg-open to open a terminal, then open vim with the…
Evan
- 571
- 1
- 5
- 11
14
votes
2 answers
What's the right way to add directories to XDG_DATA_DIRS?
I've installed some app under /opt/myapp, which has a /opt/myapp/share directory. As I finish installing, it tells me:
Note that '/opt/myapp/share' is not in the search path
set by the XDG_DATA_HOME and XDG_DATA_DIRS
environment variables, so…
einpoklum
- 8,772
- 19
- 65
- 129
12
votes
2 answers
How to open an .png type image in Linux terminal?
I just can't find the command to display a *.png image! I tried xdg-open command but it failed:
[student@seqpapl1 Images]$ xdg-open adapter_content.png
xdg-open: no method available for opening 'adapter_content.png'
I am currently running ubuntu…
Genie
- 123
- 1
- 1
- 5
12
votes
4 answers
Can't change the xdg-open url-handler to Firefox
My problem is that many programs call xdg-open to open websites but on my Manjaro system (based on Arch Linux) this is somehow bound to cups :)
When such a call to xdg-open happens, the CPU usage goes up a lot, without anything happens. I restart…
joemaro
- 123
- 1
- 1
- 8
12
votes
1 answer
How can I run a .desktop file?
I'm trying to write a script that launches the default application for a given mime type. For example, I would like to say my-script text/plain and have it open KWrite for me.
What I know is that you can use xdg-mime to query what is the default…
hugomg
- 5,543
- 4
- 35
- 53
11
votes
2 answers
xdg-open is installed yet also is not installed
$ xdg-open
The program 'xdg-open' is currently not installed. You can install it by typing:
sudo apt-get install xdg-utils
$ sudo apt-get install xdg-utils
Reading package lists... Done
Building dependency tree
Reading state information...…
nacnudus
- 253
- 1
- 2
- 8
10
votes
2 answers
How to set the default web browser used to open URLs under i3?
I have tried to set my default browser for opening URLs to Chromium using:
xdg-settings set default-web-browser chromium.desktop
(yes I checked out whether /usr/share/applications/chromium.desktop existed first before running this command and it…
Josh Pinto
- 3,483
- 15
- 52
- 87
10
votes
1 answer
xdg-open opens a different application to the one specified by xdg-mime query
I run Debian Jessie without a desktop environment (I use the tiling window manager i3) and like to use xdg-open to quickly open files using a preferred application. I have an ongoing problem setting the preferred app for PDF files though. This is…
Tim
- 203
- 2
- 5
8
votes
1 answer
How to make xdg-open follow mailcap settings in Debian
tl;dr:
In Debian xdg-open (through xdg-mime) does not follow the mailcap specifications used by run-mailcap which I prefer to use. Is there some systematic way to make xdg-open follow the mailcap entries? Ideally less hacky than to modify the…
Ondřej Grover
- 403
- 3
- 8
7
votes
4 answers
xdg-open on debian 9 fails to open browser
I decided to try lxdm (was using fluxbox and xfce), and discovered that for many programs the url handler was failing, producing this error message;
Quite strange as you can see, it's prepending the user directory to the url.
The example here is…
Evil Spork
- 173
- 1
- 6
6
votes
1 answer
What program to use to open files? (gnome-open, gvfs-open, xdg-open, etc.)
I have a Java program that runs on Linux, and from within the program, I want to open files (e.g. PDF files) with the system's native viewer. There are various programs available for this purpose: gnome-open, gvfs-open, xdg-open, ...
Which one(s)…
python dude
- 163
- 4