Questions tagged [xdg-open]

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.

Filter by
Sorted by
Tagged with
0 votes
2 answers
23 views

How to open a file starting with dash via xdg-open

Usually, a double dash separates options from filenames, but xdg-open does not care: ❯ xdg-open -headlinesAfter.epub xdg-open: unexpected option '-headlinesAfter.epub' Try 'xdg-open --help' for more ...
xeruf's user avatar
  • 531
1 vote
0 answers
48 views

Design .desktop File to Launch the Default Terminal Emulator with Arguments

I'd like to be able to open text and source code files in neovim (or any other terminal-based text editor) when an XDG-compatible GUI application asks with which application to open that file. For now,...
Marcus Müller's user avatar
0 votes
0 answers
44 views

Open file from terminal in already running "pure data" instance

Whenever I xdg-open patch.pd it will open a new pure data instance, how can I make it open with existing instance?
Leo Zerino's user avatar
0 votes
1 answer
224 views

`xdg-open /` opens in browser when not already in terminal

I have set default file manager to ranger (xdg-mime query default inode/directory = ranger.desktop). Yet, when I am not in the terminal already, xdg-open / opens in the browser. I have checked in /usr/...
JosefLitos's user avatar
0 votes
1 answer
210 views

Controll the application that opens the links

My scenario is simple - I have two browser profiles, personal and work. Now I have two sources I get urls. My goal is to have a way to open urls from one source (let's say Slack) with personal profile ...
kosciej16's user avatar
  • 113
0 votes
1 answer
419 views

Browser download location file manager is not using system default file manager

As a bit of background, I'm using Arch Linux with i3 as my window manager and I recently stopped using Nautilus as my default file manager and started using Thunar. The browser I'm using is Brave and ...
BingoKnight's user avatar
0 votes
1 answer
158 views

How to run application/x-executable in nnn file manager?

I'm trying to open executable files in nnn. In my case the executable is the Telegram. When I try to open it using nnn the firefox will open. I searched over the net and figure out I should set a ...
Amir reza Riahi's user avatar
2 votes
1 answer
561 views

google-chrome-stable not respecting xdg-open

I have a file downloaded using google-chrome-stable in ~/Downloads/video.mkv, but clicking the file in Chrome's downloads page somehow opens the file in Firefox instead of my default video player. ...
Kyle Richards's user avatar
0 votes
0 answers
78 views

Launching xdg-open from dmenu

$ xdg-mime query default `xdg-mime query filetype t.txt` nvim.desktop and xdg-open t.txt works as expected. However, typing dmenu_run in terminal then xdg-open ~/t.txt results in infinite loop: ...
AvidSeeker's user avatar
1 vote
0 answers
134 views

On running xdg-settings get default-we-browser, I get the following message "unknown desktop environment"

I am running an R script that tries to open a link on the linux server. But on running the script, I get the following error xdg-open: no method available for opening 'https://unix.stackexchange.com/' ...
Narayan Shubha's user avatar
0 votes
0 answers
624 views

Can't change default web browser in linux mint

I recently installed Linux mint 21.1 Xfce 4.16.0. I'd like my default web browser to be google chrome. dg-settings get default-web-browser shows google-chome.desktop as my default browser. ...
Bunny's user avatar
  • 41
1 vote
1 answer
101 views

How to pass URL string in .desktop file in quotes

I installed WhatsApp Desktop via Wine and I am trying to associate whatsapp:// links with it. Executing the following via command line works and starts a chat with the phone number +1234567890: env ...
Mike's user avatar
  • 459
1 vote
2 answers
812 views

Escape spaces in path in export variable (Ubuntu 22.04.1 LTS)

I use WSL2 (Ubuntu 22.04.1 LTS) and need to refer to edge-browser for xdg-open. Due to the space in the path I get an error. How can I escape the space? The path is shown corrrectly in exported ...
Daniel's user avatar
  • 33
0 votes
1 answer
676 views

xdg-open opening wrong application

I do not know where to ask this. When I type help, I get "help: Help is being displayed in xdg-open." Which is normal I suppose, but the problem is it opens up in Todoist application, which ...
cade's user avatar
  • 1
4 votes
0 answers
574 views

default-url-scheme-handler not implemented for xfce

I run this code on kali linux: xdg-settings set default-url-scheme-handler https google-chrome.desktop I got this error: xdg-settings: default-url-scheme-handler not implemented for xfce how can I ...
Yilmaz's user avatar
  • 319
2 votes
1 answer
928 views

How Can I Open Multiple Files With xdg-open

Let's say I run xdg-open file.flac. It will be equivalent to mpv file.flac. But if I run xdg-open *.flac, it will give me an error because it thinks that the other files are "unexpected arguments&...
Amarakon's user avatar
  • 303
1 vote
1 answer
298 views

Xdg-Mime won't change default application for .xopp (Xournalpp) files

I'm trying to change the default application for the filetype .xopp, which is a file for the xournalpp application. I currently ran the following commands: xdg-mime query filetype 2022-06-09/note.xopp ...
SingularisArt's user avatar
0 votes
0 answers
183 views

URL ampersand escape xdg-open command

I am trying to open a URL using the xdg-open command, but I have tried escaping the ampersand character to no avail; all possible choices don't work in bash. I have tried the following xdg-open "...
Mathpdegeek497's user avatar
1 vote
1 answer
444 views

protonvpn RuntimeError: Couldn't find acceptable executables for {'xdg-open'}

EDIT #3: After a series of attempts at removing packages, and installing again with/without the virtualenv, I came across various hurdles, which required me doing (with the help of ref, ref) $ conda ...
sancho.s ReinstateMonicaCellio's user avatar
-1 votes
1 answer
430 views

Arch Linux: Is it possible to configure chromium to be my default browser for only a single website?

xdg-settings get default-web-browser produces firefox.desktop. This is what I want in almost every case. For a single website I want links to open in chromium.
Zach LeFevre's user avatar
0 votes
1 answer
326 views

How to reveal a file in file explorer

Is there any solution as cross-platform as xdg-open is for revealing a file in the user's file explorer? xdg-open /path/to/file unfortunately opens the file, but all I want to do is open the file ...
theonlygusti's user avatar
5 votes
2 answers
8k views

Custom URI handling: xdg-open and Firefox work, but Chrome doesn't

I'm trying to configure my Linux environment to open obsidian:// URIs using the Obsidian app (see Using Obsidian URI). This is the flow I'm using. I'm doing this on a clean Ubuntu machine to make sure ...
Amir Rachum's user avatar
1 vote
1 answer
2k views

xdg-open from .desktop file (in script)

I am trying to get a shell script to launch a browser. When run standalone, this script successfully opens a browser with xdg-open http://localhost:8080 However, I am trying to make it convenient ...
Real's user avatar
  • 125
2 votes
1 answer
2k views

Windows browser specific to program within WSL

I'm in a Windows Subsystem for Linux (WSL) Ubuntu 20.04 LTS. My ~/.zshrc file currently has the following appended to the end of the file. export BROWSER='/mnt/c/Program Files/BraveSoftware/Brave-...
Carl C's user avatar
  • 23
1 vote
1 answer
396 views

Open default application for file and wait until it terminates

I tried to use xdg-open but it does not wait until the application terminates. I also tried to get the MIME-type of the file with xdg-mime query filetype fileHere and using xdg-mime query default MIME-...
Cookie04's user avatar
  • 123
2 votes
1 answer
262 views

Skip the browser page when opening https URIs for Zoom, Teams, and other native apps

Android has a convenient feature: certain https links that have associated local apps installed are opened directly in these apps, skipping the browser page. How do I achieve this in Linux? I have ...
Tom Adler's user avatar
  • 181
0 votes
1 answer
3k views

Ranger: set default apps for files

I use arch linux, ranger and nvim. When I try to open any text file, ranger does not do anything and this is on output: /bin/sh: line 1: vim: command not found What can i do to open file in neovim ?
Jan Černý's user avatar
  • 1,277
1 vote
1 answer
162 views

.local/share/applications isn't detected by xdg-mime

I'm trying to change the default program to open PDF files with xdg-open using the command xdg-mime default pdf.desktop application/pdf. The file pdf.desktop is already in ~/.local/share/applications. ...
Rik Ferreira's user avatar
5 votes
0 answers
1k views

Portable way to set custom URL scheme handler for all users

I already know how to create a custom URL scheme and set its handler using xdg-utils: xdg-settings set default-url-scheme-handler name handler.desktop However, the command affects only the current ...
trungnt2910's user avatar
1 vote
2 answers
555 views

Cannot open multiple instances of Firefox with xdg-open or kde-open5 in OpenSUSE due to "Firefox is already running" error

When I try from the command line $ kde-open5 http://unix.stackexchange.com/ $ xdg-open http://unix.stackexchange.com/ ... I get after a few seconds a dialog box on X11 telling me that Firefox is ...
Richard Gomes's user avatar
0 votes
1 answer
2k views

Launching a program via `xdg-open` from a subshell without blocking

I've noticed that calling xdg-open from a subshell will reliably block until the launched process is closed. I suspect there may be a reason for this, but I'm not sure as to why. For example, ...
wardw's user avatar
  • 316
1 vote
0 answers
853 views

How do I unset my default xdg browser?

I want to debug a program's behaviour when the user has no default web browser set, but I'm not sure how I'd return to this state after setting one. I know that I can set my default browser via xdg-...
Newbyte's user avatar
  • 946
5 votes
2 answers
1k views

Setting default browser for zathura

So I have trouble setting the default browser for opening links in zathura. I would like to use chrome however Palemoon is always used instead. I am on Manjaro with i3. First of all xdg-open "...
szynka12's user avatar
2 votes
1 answer
3k views

How to xdg-open specific links with different apps

Hi I want to open specific link with specific application. To be more specific, I want to open zoom links https://us02web.zoom.us/j/something?pwd=somethingsomething with desktop-ish zoom application (...
Demiler's user avatar
  • 43
1 vote
1 answer
1k views

Where is the relevant .desktop file?

I can open a Python source file using xdg-open, e.g., $ xdg-open Documents/tmp/paramk.py Waiting for Emacs... $ what happens is that emacsclient is invoked and xdg-open returns when I close the Emacs'...
gboffi's user avatar
  • 1,352
0 votes
1 answer
186 views

xdg-open is only using gedit

Something went wrong on a whole bunch of machines, and I can't figure out what or where or when or how. Red Hat Enterprise Linux Workstation release 6.10 (Santiago) All of my desktop icons are not ...
hymie's user avatar
  • 1,710
3 votes
1 answer
800 views

How to register new mimetypes not available in xfce4-mime-settings so that they are recognized with xdg-open under XFCE4?

I am trying to register new mimetypes under XFCE4. In particular, I would like to register the protocol zoommtg so I can launch Zoom meetings from links in the webbrowser Chrome. Chrome will launch ...
Pete's user avatar
  • 133
1 vote
0 answers
652 views

Is it possible to tell xdg-open (or alikes) to open a window in the background?

I am using xdg-open with cronjobs to open our time-management web-app once per hour to log my time (among other repeating things). This works very well, but has an annoying usability problem. Once ...
Gerrit Addiks's user avatar
1 vote
1 answer
2k views

chromium: specify file association, instead of opening file in xdg-open

When I click on a file in chromium, it calls xdg-open to open the file based on its mime type. For example, if I click on a file with a .torrent extension, it opens it in my torrent client. Is it ...
Martin Vegter's user avatar
3 votes
1 answer
263 views

xdg-open autocomplete not working when calling it with alias

I've set an alias to xdg-open adding alias op="xdg-open" to my ~/.bashrc file. The command op file.pdf works, but I'm not able to autocomplete when typing, for example, op fi and hitting TAB....
fefff's user avatar
  • 41
1 vote
1 answer
404 views

Where does xdg-mime save its per-user default app settings?

Where does xdg-mime save the settings I make with commands which set the default app to handle MIME types? i.e. commands such as: xdg-mime default evince.desktop application/pdf ? I'm using SLES (...
einpoklum's user avatar
  • 9,217
5 votes
3 answers
596 views

Opening a URL with xdg-open using Mozilla Remote Protocol

Older versions of Netscape and Mozilla (for X11) supported the so-called remote protocol: it was possible to open a URL or start composing an e-mail whenever a Netscape/Mozilla window (not necessarily ...
Bass's user avatar
  • 259
0 votes
1 answer
123 views

Mirror image video using xdg-open

I am using a web cam in Zoom, which opens xdg-open to provide the video feed. Unfortunately the feed is mirror image, so if I have text in the image then it is reversed and unreadable. How can I ...
Tyler Durden's user avatar
  • 5,551
0 votes
0 answers
241 views

Wait for forking process to complete

I have an application which does this: #!/bin/bash tmpfile=$(mktemp) gedit $tmpfile && pkexec mv $tmpfile $1 Works great. It creates a temp file, opens it in a graphical editor, and it gets ...
Stewart's user avatar
  • 13.1k
1 vote
1 answer
555 views

`serverless login` return Error: spawn /home/imin/.serverless/bin/xdg-open ENOENT

As a linux newbie, I tried installing lubuntu-18.04.4-desktop-amd64 in my VMware to do my development work there. Installation is a breeze, now I'm trying to install Serverless as per the guide here ...
imin's user avatar
  • 111
2 votes
1 answer
3k views

Unable to open URL with xdg-open

Getting this error as regular user: ~$ xdg-open http://www.google.com/ xdg-open: no method available for opening 'http://www.google.com/' ~$ ~$ xdg-mime query default text/html ~$ Code from /usr/bin/...
xavier96's user avatar
2 votes
1 answer
937 views

Exceptions with xdg-open when starting programs in the background

Until now I've been using the alias to xdg-open. alias o='xdg-open $@ 2> /dev/null' The default behaviour for xdg-open is to start the process in the foreground of the currently selected terminal ...
user avatar
3 votes
1 answer
3k views

How to associate a new (custom) mime type with files (based on file extension)?

This is part 2 of How to install a new (custom) mime type on my Linux system using CLI tools? Using the steps in the accepted answer at the above question, I created the following mime-type mx-...
MountainX's user avatar
  • 17.5k
3 votes
1 answer
4k views

xdg-open fails to open file [closed]

I was trying to open an Excel file with python on Linux using xdg-open but realized xdg-open doesn't really work on my machine: $ xdg-open ~/Documents/foo.xlsx /usr/bin/xdg-open: line 881: www-...
BlindDriver's user avatar
0 votes
0 answers
809 views

Configure xfce to use an alternative to the xdg-open program

I wonder how I would change the default file open application in xfce. In the terminal I always use rifle (from the terminal file manager ranger) and I would like to use rifle as well for when I open ...
Hielke Walinga's user avatar