Manually setting KDE default applications without full KDE installation

3

0

I use Okular in an XFCE environment (archlinux). How can I set the default browser to use for opening URLs without installing a full KDE configuration panel?

As is, it does not use my default browser. From strace i believe it uses /usr/lib/kf5/kioslave5. I tried setting ~/.config/mimeapps.list as per this description:

[Default Applications]
x-scheme-handler/http=vivaldi-stable.desktop;
x-scheme-handler/https=vivaldi-stable.desktop;

To no avail. I also tried exo-web-browser.desktop.

Note that this question refers to KDE4, so I believe it does not apply.

To clarify: I have vivaldi set as preferred application / web browser as per the XFCE control panel. If I use xdg-open http://... it uses vivaldi. I do have two files ~/.local/share/xfce4/helpers/{custom-WebBrowser.desktop,vivaldi-stable.desktop}, both referring to vivaldi.

Zulan

Posted 2020-02-05T19:27:25.897

Reputation: 229

Try the answer in the last entry in this page. If it doesn't help, do you have Preferred Applications in the Xfce Settings Manager? Or xfce4-settings-manager? And why avoid installing the KDE configuration panel?

– harrymc – 2020-02-10T07:40:47.280

The xfce settings all point to vivaldi. I clarified the details in an edit. I would prefer to keep my installation as lean as possible, while I don't mind getting dirty with editing some files. I also don't know which Archlinux package contains the KDE configuration panel - so for practical reasons I would appreciate a hint in that direction. – Zulan – 2020-02-10T11:45:23.523

The archlinux package seems to be xfce4-settings 4.14.2-1. If I understand right, you would rather not install it.

– harrymc – 2020-02-10T11:57:14.907

I do have xfce4-settings. I do not have the KDE configuration panel (package). – Zulan – 2020-02-10T13:23:16.533

If you can open xfce4-settings-manager, then my linked answer might apply. – harrymc – 2020-02-10T13:39:21.223

There seems to be some misunderstanding here. I do have vivaldi set as preferred application / Web Browser in the xfce4-settings-manager. This works with some applications. But it does not work with Okular, a KDE application, which appears to use kioslave5 that does not seem to respect the XFCE / XDG setting. – Zulan – 2020-02-10T17:06:47.443

This is clearer now. Try this solution.

– harrymc – 2020-02-10T17:16:10.570

Thanks, I went ahead installed kcmshell5 from kde-cli-tools which also required a manual installation of plasma-workspace complete with 34 additional dependencies. Then I figured out the answer (see below) - which also relates to the specific answer you linked. – Zulan – 2020-02-10T18:26:59.297

Answers

1

Using ~/.config/mimeapps.list / [Default Applications] was correct all along. However, Okular uses text/html instead of x-scheme-handler/http(s). So for me, it looks like.

[Default Applications]
text/html=vivaldi-stable.desktop;

This can also be edited with xfce4-mime-settings.

It appears that Okular specifically first downloads all urls internally and only then decides how to handle it as per the mime type of the document.

Zulan

Posted 2020-02-05T19:27:25.897

Reputation: 229

2

(The full answer is given by the poster. This answer only details the links that pointed to it.)

The Ask Ubuntu post Clicking links in pdfs opened with Okular opens Abiword (instead of the default browser) contained the essential hint that Okular uses the file type of text/html, rather than html, so this was the one to look for.

In my comments above I also mentioned the utility xfce4-mime-settings that can edit these settings, which lives currently in the Arch Linux package xfce4-settings 4.14.2-1.

harrymc

Posted 2020-02-05T19:27:25.897

Reputation: 306 093