Skip to content

Commit

Permalink
Changed some Firefox settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlendea committed Feb 10, 2025
1 parent 259762f commit e8f047c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions scripts/common/system-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ function is_driver_loaded() {
fi
}

function get_memory_total_gb() {
free -g | awk '/^Mem:/ {print $2 " GB"}' | awk '{print $1}'
}

function get_wifi_driver() {
get_driver "wifi"
}
Expand Down
21 changes: 13 additions & 8 deletions scripts/configure-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,12 @@ fi
###############
### FIREFOX ###
###############
if does_bin_exist "firefox" "firefox-esr" "librewolf" "org.mozilla.firefox" "io.gitlab.librewolf-community"; then
if does_bin_exist 'firefox' 'firefox-esr' 'librewolf' 'org.mozilla.firefox' 'io.gitlab.librewolf-community'; then
FIREFOX_PROFILE_DIR=$(get_firefox_profile_dir)

# First time prompts
set_firefox_config "${FIREFOX_PROFILE_DIR}" app.normandy.first_run false
set_firefox_config "${FIREFOX_PROFILE_DIR}" browser.aboutConfig.showWarning false
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'app.normandy.first_run' false
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.aboutConfig.showWarning' false
set_firefox_config "${FIREFOX_PROFILE_DIR}" "browser.shell.checkDefaultBrowser" false
set_firefox_config "${FIREFOX_PROFILE_DIR}" browser.urlbar.quicksuggest.onboardingDialogChoice "settings"
set_firefox_config "${FIREFOX_PROFILE_DIR}" "browser.urlbar.quicksuggest.showedOnboardingDialog" true
Expand Down Expand Up @@ -880,10 +880,10 @@ if does_bin_exist "firefox" "firefox-esr" "librewolf" "org.mozilla.firefox" "io.

# Preferences
#set_firefox_config "${FIREFOX_PROFILE_DIR}" "browser.download.lastDir" "${XDG_DOWNLOAD_DIR}"
set_firefox_config "${FIREFOX_PROFILE_DIR}" "browser.formfill.enable" true
set_firefox_config "${FIREFOX_PROFILE_DIR}" "browser.startup.page" 3 # Reopen previous tabs on startup
set_firefox_config "${FIREFOX_PROFILE_DIR}" "media.autoplay.enabled" false
set_firefox_config "${FIREFOX_PROFILE_DIR}" "media.autoplay.blocking_policy" 2
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.formfill.enable' true
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.startup.page' 3 # Reopen previous tabs on startup
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'media.autoplay.enabled' false
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'media.autoplay.blocking_policy' 2

# Appearance - Links
set_firefox_config "${FIREFOX_PROFILE_DIR}" "browser.anchor_color" "${TERMINAL_CYAN_D}" # "#00BCD4"
Expand All @@ -910,6 +910,12 @@ if does_bin_exist "firefox" "firefox-esr" "librewolf" "org.mozilla.firefox" "io.
set_firefox_config "${FIREFOX_PROFILE_DIR}" "browser.gnome-search-provider.enabled" true

# Performance
if [ $(get_memory_total_gb) -ge 15 ]; then
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.cache.disk.enable' false
else
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.cache.disk.enable' true
fi
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.sessionstore.interval' 30000
set_firefox_config "${FIREFOX_PROFILE_DIR}" "dom.ipc.processCount" $(nproc) # Limit to the number of physical cores, to save resources and save battery power
set_firefox_config "${FIREFOX_PROFILE_DIR}" "network.dnsCacheEntries" $((DNS_CACHE_SIZE/10))
set_firefox_config "${FIREFOX_PROFILE_DIR}" "network.dnsCacheExpiration" $((DNS_CACHE_TTL*60))
Expand Down Expand Up @@ -988,7 +994,6 @@ if does_bin_exist "firefox" "firefox-esr" "librewolf" "org.mozilla.firefox" "io.

# Other
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.bookmarks.max_backups' 3
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.cache.disk.enable' true
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.print.enabled' false
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'browser.tabs.remote.warmup.enabled' false
set_firefox_config "${FIREFOX_PROFILE_DIR}" 'full-screen-api.ignore-widgets' true
Expand Down

0 comments on commit e8f047c

Please sign in to comment.