Picky
This program lets you open URIs using different browsers (or profiles) following a set of rules.
Table of Contents
Example config
Picky is driven by a configuration file located at $HOME/.config/picky/config
.
debug: true
default: &default
command: chromium-browser
args: ["--profile-directory=Default Profile"]
rules:
- <<: *default
args: First Profile
uris:
- hotmail.com
- gmail.com
- <<: *default
args: Second Profile
uris:
- (cnn|nyt).com
Installation
$ go get -u git.sr.ht/~jcmuller/picky
$ mkdir -p ~/.local/share/applications; cp picky.desktop ~/.local/share/applications
Debian based OSs
$ sudo update-alternatives --install /usr/bin/picky x-www-browser /usr/local/bin/picky 100
$ sudo update-alternatives --install /usr/bin/picky-gnome gnome-www-browser /usr/local/bin/picky 100
$ xdg-settings set default-web-browser picky.desktop
More generic solution
$ echo >~/.config/mimeapps.list <<-EOF
[Default Applications]
application/x-extension-html=picky.desktop
application/x-extension-htm=picky.desktop
application/x-extension-shtml=picky.desktop
application/x-extension-xhtml=picky.desktop
application/x-extension-xht=picky.desktop
application/xhtml+xml=picky.desktop
text/html=picky.desktop
x-scheme-handler/chrome=picky.desktop
x-scheme-handler/ftp=picky.desktop
x-scheme-handler/http=picky.desktop
x-scheme-handler/https=picky.desktop
x-scheme-handler/irc=brave-browser.desktop
x-scheme-handler/ircs=brave-browser.desktop
x-scheme-handler/slack=slack.desktop
x-scheme-handler/tel=brave-browser.desktop
EOF
Usage
$ picky SOME_URI