From 62ddfc3a2c4bc9d166fbcf8490be4b3e2add6504 Mon Sep 17 00:00:00 2001 From: zenobit Date: Sun, 29 Oct 2023 00:38:05 +0200 Subject: [PATCH] add open_url function --- quickget | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quickget b/quickget index 44e8532..74f393f 100755 --- a/quickget +++ b/quickget @@ -2532,6 +2532,11 @@ function get_windows() { esac } +open_url() { + local URL="$1"; + xdg-open $URL || sensible-browser $URL || x-www-browser $URL || gnome-open $URL; +} + create_vm() { # shellcheck disable=SC2206 local URL_HASH=(${1// / }) @@ -2682,8 +2687,7 @@ if [ -n "${2}" ]; then else if [ "${open_distro_homepage}" == 'on' ]; then homepage=$(os_homepages | sed 's/\s\+/\n/g' | grep ${OS} | cut -d'/' -f2-9) - echo "${homepage}" - xdg-open "${homepage}" && exit 0 + open_url "${homepage}" && exit 0 fi echo "ERROR! You must specify a release." case ${OS} in