Skip to content

xdg-open URL & choose browser profile

I'm running different firefox.desktop and google-chrome.desktop browser profiles. Current xdg-mime query default "text/html" reports firefox.desktop, but I'm looking to quickly switch or have some dmenu option to choose which browser instance to open a link in.

I know how to switch profiles using -P in Firefox, but in chrome it's --user-data-dir I guess? Anyone have a good solution for this problem?

2 points4 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
obd301

Author

85
posts
264
comments
54
media
View profile

4 comments

kaiOP2 hidden

I'm actually really confused now, since Firefox still opens despite:

$ xdg-mime default google-chrome.desktop text/html
$ xdg-mime query default "text/html"
google-chrome.desktop
$ xdg-open https://example.com
1 points

text/html might be just local html files. You need to set x-scheme-handler/http and x-scheme-handler/https.

1 points

~/.config/mimeapps.list

[Default Applications]
application/xhtml+xml=browser.desktop
x-scheme-handler/https=browser.desktop

No need to use xdg-open from commandline for anything else than querying the filetyeps, I for example have it set to open any youtube link in mpv rather than fireforx, this way my gui rss reader I only use for youtube channels opens and queues them in mpv.

You can do whatever menus you want, before using an rss reader I downloaded all the thumbnails of yt videos to a folder and made img.desktop load the url contained in the image name in mpv rather than open the img if it's in that one specific folder.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.