picky

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 10 Imported by: 0

README

Picky

Go Report Card MIT Go Reference builds.sr.ht status

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

Documentation

Overview

Package main is the entrypoint

Directories

Path Synopsis
Package chooser chooses what browser to use depending on a rule and URI
Package chooser chooses what browser to use depending on a rule and URI
Package config has configuration responsibilities
Package config has configuration responsibilities
Package rule wraps heuristics to choose browsers
Package rule wraps heuristics to choose browsers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL