tessen

default description
git clone https://git.awy.one/tessen.git
Log | Files | Refs | README | LICENSE

commit 9d0a8def782fca42031a9da9cb86d03614a306e7
parent e335d8a23f91740f27be1d5ff420444cfc64c03e
Author: Ayush Agarwal <ayush@fastmail.in>
Date:   Wed, 16 Feb 2022 22:16:32 +0530

refactor!: remove support for $BROWSER

the config file supports setting a web browser of your choice and if it
is provided, it will used irrespective of what the default web browser
is according to XDG. if a user wants to use xdg-open, leave the
web_browser config flag commented in the config file.

Diffstat:
Mtessen | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tessen b/tessen @@ -399,14 +399,14 @@ key_otp() { # open the url using either xdg-open or tsn_web_browser # if tsn_web_browser is defined, xdg-open won't be used key_open_url() { - if is_installed xdg-open; then - xdg-open "$1" 2> /dev/null || { - printf "%s\n" "xdg-open was unable to open '$1'" >&2 + if [[ -n "$tsn_web_browser" ]]; then + "$tsn_web_browser" "$tsn_url" > /dev/null 2>&1 || { + printf "%s\n" "$tsn_web_browser was unable to open '$tsn_url'" >&2 return 1 } - elif [[ -n "$BROWSER" ]] && is_installed "$BROWSER"; then - "$BROWSER" "$1" > /dev/null 2>&1 || { - printf "%s\n" "$BROWSER was unable to open '$1'" >&2 + elif is_installed xdg-open; then + xdg-open "$tsn_url" 2> /dev/null || { + printf "%s\n" "xdg-open was unable to open '$tsn_url'" >&2 return 1 } else