Merge pull request #258 from codename-cn/firefox-flatpak-support

Add support for firefox installed with flatpak
This commit is contained in:
Vince 2021-05-30 18:42:09 +08:00 committed by GitHub
commit 019e2dc648
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -44,6 +44,8 @@ DASH_TO_DOCK_DIR_HOME="/home/${MY_USERNAME}/.local/share/gnome-shell/extensions/
FIREFOX_SRC_DIR="${REPO_DIR}/src/other/firefox"
FIREFOX_DIR_HOME="/home/${MY_USERNAME}/.mozilla/firefox"
FIREFOX_THEME_DIR="/home/${MY_USERNAME}/.mozilla/firefox/firefox-themes"
FIREFOX_FLATPAK_DIR_HOME="/home/${MY_USERNAME}/.var/app/org.mozilla.firefox/.mozilla/firefox"
FIREFOX_FLATPAK_THEME_DIR="/home/${MY_USERNAME}/.var/app/org.mozilla.firefox/.mozilla/firefox/firefox-themes"
export WHITESUR_TMP_DIR="/tmp/WhiteSur.lock"
if [[ -w "/" ]]; then

View file

@ -67,7 +67,13 @@ while [[ $# -gt 0 ]]; do
edit_firefox="true" ;;
esac
if ! has_command firefox; then
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
prompt -e "'${1}' ERROR: There's no Firefox installed in your system"
has_any_error="true"
elif [[ ! -d "${FIREFOX_DIR_HOME}" ]]; then