Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 52219  / 2 Years ago, fri, may 13, 2022, 12:36:06

I want to use xdg-open to open irc:// links, how can I make the required parameter?


More From » xdg-open

 Answers
2

xdg-open basically just looks to see which desktop environment you have and then runs gnome-open, gvfs-open, xfce-open, etc. See below for desktop environment specific instructions...



Gnome



Gnome uses the gnome-open program which uses gconf to store everything. For example on my machine with Ubuntu 10.10 running gnome-open irc://blah opens up xchat because xchat includes a gconf setting patch to add an irc:// handler.



gconf-editor showing irc with xchat configuration



This shows how gnome does this, with a gconf settings in /desktop/gnome/url-handlers/. See xchat-2.8.8/src/common/dbus/apps_xchat_url_handler.schemas as an example.



KDE



For KDE you should look at the .protocol files in /usr/share/kde4/services/, create a new one for your new protocol and put it in ~/.kde/share/kde4/services/, if it's super useful then consider adding it to the package as a fix for other users.



KDE is using kde-open or kfmclient depending on what's available and what version of KDE you have.



XFCE



XFCE uses a program called exo-open, this program doesn't have any way to configure it or add uri handlers. Looking through the source code shows that is uses desktop files to specify only three types of programs. TerminalEmulator, WebBrowser and EmailClient.



With XFCE4 (and probably also others) it is possible to configure xdg-open to define a custom protocol handler. In some you have to create/edit the following files:



~/.local/share/applications/protocolhandler.desktop
~/.local/share/applications/mimeapps.list



An example adding a handler for the ed2k protocol is provided at stackexchange.com2.


[#43396] Saturday, May 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainbby

Total Points: 184
Total Questions: 115
Total Answers: 112

Location: Colombia
Member since Thu, Sep 29, 2022
2 Years ago
ainbby questions
Thu, Mar 23, 23, 10:26, 1 Year ago
Wed, May 10, 23, 00:10, 1 Year ago
Fri, Apr 15, 22, 10:11, 2 Years ago
;