dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 722ec4cf3b249dc6deecc86a163b1c90be6eea06
parent 195bdb2332f185e160d5d56f09113ca0d4ca7215
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Wed, 13 Jan 2021 23:01:08 +0100

linkhandler: prefix with '!' for GUI browser

Diffstat:
Mscripts/linkhandler | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/scripts/linkhandler b/scripts/linkhandler @@ -26,6 +26,23 @@ case "$1" in http://*|https://*) # everything else gets filtered through readability go-readability "$1" | w3m -config ~/.config/w3m/config -T text/html ;; + '!http'*) + os=$(uname -s | tr '[:upper:]' '[:lower:]') + case "$os" in + linux*) + setsid -f brave "${1##!}" + ;; + darwin*) + open -a 'Brave Browser' "${1##!}" + ;; + msys*|cygwin*|mingw*|nt|win*) + printf "Windows not supported.\n" >&2 + ;; + *) + printf "Operating system %s is unknown.\n" "$os" + ;; + esac + ;; *) if [ -f "$1" ]; then "$EDITOR" "$1" else open "$1" >/dev/null 2>&1