From 83c91c284d92060a13f75b8178a98e8215e3ae6c Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Sun, 30 May 2021 19:19:49 +0700 Subject: [PATCH 1/3] Critical update: correcting Firefox installation workflow --- lib-install.sh | 1 + tweaks.sh | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib-install.sh b/lib-install.sh index 13f20b51..06825c21 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -434,6 +434,7 @@ revert_gdm_theme() { install_firefox_theme() { remove_firefox_theme + userify mkdir -p "${FIREFOX_THEME_DIR}" userify cp -rf "${FIREFOX_SRC_DIR}" "${FIREFOX_THEME_DIR}" config_firefox } diff --git a/tweaks.sh b/tweaks.sh index cc707011..58b95684 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -67,20 +67,14 @@ while [[ $# -gt 0 ]]; do edit_firefox="true" ;; esac - if [[ -d "${FIREFOX_FLATPAK_DIR_HOME}" ]]; then - FIREFOX_DIR_HOME=${FIREFOX_FLATPAK_DIR_HOME} - mkdir -p ${FIREFOX_FLATPAK_THEME_DIR} - FIREFOX_THEME_DIR=${FIREFOX_FLATPAK_THEME_DIR} - fi; - - if [[ ! -d "${FIREFOX_FLATPAK_DIR_HOME}" ]] && ! has_command firefox; then + if ! has_command firefox && [[ ! "$(flatpak list --columns=application 2> /dev/null | grep org.mozilla.firefox)" ]]; then prompt -e "'${1}' ERROR: There's no Firefox installed in your system" has_any_error="true" - elif [[ ! -d "${FIREFOX_DIR_HOME}" ]]; then + elif [[ ! -d "${FIREFOX_DIR_HOME}" ]] && (has_command flatpak && [[ ! -d "${FIREFOX_FLATPAK_DIR_HOME}" ]]); then prompt -e "'${1}' ERROR: Firefox is installed but not yet initialized." prompt -w "'${1}': Don't forget to close it after you run/initialize it" has_any_error="true" - elif pidof "firefox" &> /dev/null; then + elif pidof "firefox" &> /dev/null || pidof "firefox-bin" &> /dev/null; then prompt -e "'${1}' ERROR: Firefox is running, please close it" has_any_error="true" fi; shift ;; From 233a461a2c91d9cb39f22a00fcd8151d7acaa286 Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Sun, 30 May 2021 19:57:40 +0700 Subject: [PATCH 2/3] Critical update: correcting Firefox installation workflow --- lib-core.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib-core.sh b/lib-core.sh index 721e3792..e7fa2b16 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -257,6 +257,7 @@ check_param() { local has_any_ambiguity_error="false" local variant_found="false" + if [[ "${has_set["${global_param}"]}" == "true" ]]; then need_dialog["${global_param}"]="true" From 80f1ee96e7a971df22ade1189b52d31f0e4b1866 Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Sun, 30 May 2021 20:11:55 +0700 Subject: [PATCH 3/3] Critical update: correcting Firefox installation workflow --- lib-core.sh | 2 +- lib-install.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib-core.sh b/lib-core.sh index e7fa2b16..328b31ad 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -196,7 +196,7 @@ has_command() { } has_flatpak_app() { - flatpak list --columns=application 2> /dev/null | grep "${1}" || return 1 + flatpak list --columns=application 2> /dev/null | grep "${1}" &> /dev/null || return 1 } is_my_distro() { diff --git a/lib-install.sh b/lib-install.sh index 0dc2b2dd..85e982d0 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -433,6 +433,8 @@ revert_gdm_theme() { ############################################################################### install_firefox_theme() { + #TODO: add support for Snap + if has_flatpak_app org.mozilla.firefox; then local TARGET_DIR="${FIREFOX_FLATPAK_THEME_DIR}" else