diff options
author | Ayush Agarwal <ayush@fastmail.in> | 2022-02-16 22:16:32 +0530 |
---|---|---|
committer | Ayush Agarwal <ayush@fastmail.in> | 2022-02-16 22:16:32 +0530 |
commit | 9d0a8def782fca42031a9da9cb86d03614a306e7 (patch) | |
tree | 59b72921a020bbb60ce9eaaa5e46121c2bfa9d81 /tessen | |
parent | e335d8a23f91740f27be1d5ff420444cfc64c03e (diff) |
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 (limited to 'tessen')
-rwxr-xr-x | tessen | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 |