From 9d2e5953f93697e298805245ea5d66b708a6af3d Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Wed, 20 Apr 2022 08:32:55 +0300 Subject: [PATCH] b/u-l-p/firefox: add conditions for local, system and flatpak installations Resolves: #38 --- bash/usr-local-bin/firefox | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/bash/usr-local-bin/firefox b/bash/usr-local-bin/firefox index 1813145..23aaf1d 100755 --- a/bash/usr-local-bin/firefox +++ b/bash/usr-local-bin/firefox @@ -7,6 +7,20 @@ set -x export MOZ_ENABLE_WAYLAND=1 -#flatpak run org.mozilla.firefox --ProfileManager $@ -/usr/bin/firefox --ProfileManager +FlagsForFirefox="--ProfileManager $@" + +# Firefox (stable, beta) and signatures: https://releases.mozilla.org/pub/firefox/releases/ +# Developer edition (and signatures): https://releases.mozilla.org/pub/devedition/releases/ +if [ -f ~/.local/firefox/firefox ] +then + ~/.local/firefox/firefox $FlagsForFirefox +# Fallback to global installation +elif [ -f /usr/bin/firefox ] +then + /usr/bin/firefox $FlagsForFirefox +# Fallback to flatpak, don't care if it doesn't exist +else + flatpak run org.mozilla.firefox $FlagsForFirefox +fi + set +x