Update 8 files
- /home/dot_local/share/firefox/distribution/policies.json - /home/dot_local/share/firefox/profiles.ini.tmpl - /home/.chezmoidata.yaml - /home/.chezmoiscripts/universal/run_onchange_after_40-firefox.tmpl - /home/dot_config/firefoxprofileswitcher/avatars.json - /home/dot_config/firefoxprofileswitcher/global-options.json - /home/dot_config/firefoxprofileswitcher/profile-options.json - /.vscode/settings.json
This commit is contained in:
parent
6f5843cfbd
commit
5558564da8
8 changed files with 85 additions and 28 deletions
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -12,7 +12,7 @@
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
"[json]": {
|
"[json]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "vscode.json-language-features"
|
||||||
},
|
},
|
||||||
"[jsonc]": {
|
"[jsonc]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
|
|
@ -67,6 +67,7 @@ chromeExtensions:
|
||||||
- https://chrome.google.com/webstore/detail/vytal/ncbknoohfjmcfneopnfkapmkblaenokb
|
- https://chrome.google.com/webstore/detail/vytal/ncbknoohfjmcfneopnfkapmkblaenokb
|
||||||
- https://chrome.google.com/webstore/detail/web-archives/hkligngkgcpcolhcnkgccglchdafcnao
|
- https://chrome.google.com/webstore/detail/web-archives/hkligngkgcpcolhcnkgccglchdafcnao
|
||||||
- https://chrome.google.com/webstore/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma
|
- https://chrome.google.com/webstore/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma
|
||||||
|
firefoxProfile: https://dash.cloudflare.com/84fa0d1b16ff8086dd958c468ce7fd59/r2/overview/buckets/public/objects/firefox-preconfigured-profile.primary.tar.gz
|
||||||
firefoxAddOns:
|
firefoxAddOns:
|
||||||
- automa
|
- automa
|
||||||
- bitwarden-password-manager
|
- bitwarden-password-manager
|
||||||
|
|
|
@ -133,26 +133,63 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app
|
||||||
fi
|
fi
|
||||||
### Initiatize Firefox default profiles
|
### Initiatize Firefox default profiles
|
||||||
if command -v "$FIREFOX_EXE" > /dev/null; then
|
if command -v "$FIREFOX_EXE" > /dev/null; then
|
||||||
|
### Create default profile by launching Firefox headlessly
|
||||||
logg info "Firefox executable set to $FIREFOX_EXE"
|
logg info "Firefox executable set to $FIREFOX_EXE"
|
||||||
if [ ! -d "$SETTINGS_DIR" ]; then
|
if [ ! -d "$SETTINGS_DIR" ]; then
|
||||||
logg info 'Running Firefox headlessly to generate default profiles'
|
logg info 'Running Firefox headlessly to generate default profiles'
|
||||||
timeout 8 "$FIREFOX_EXE" --headless
|
timeout 8 "$FIREFOX_EXE" --headless
|
||||||
logg info 'Finished running Firefox headlessly'
|
logg info 'Finished running Firefox headlessly'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
### Default profile (created by launching Firefox headlessly)
|
||||||
DEFAULT_RELEASE_PROFILE="$(find "$SETTINGS_DIR" -mindepth 1 -maxdepth 1 -name "*.default-*")"
|
DEFAULT_RELEASE_PROFILE="$(find "$SETTINGS_DIR" -mindepth 1 -maxdepth 1 -name "*.default-*")"
|
||||||
DEFAULT_PROFILE="$(find "$SETTINGS_DIR" -mindepth 1 -maxdepth 1 -name "*.default" -not -name "profile.default")"
|
# DEFAULT_PROFILE="$(find "$SETTINGS_DIR" -mindepth 1 -maxdepth 1 -name "*.default" -not -name "profile.default")"
|
||||||
if [ -n "$DEFAULT_PROFILE" ] && [ "$DEFAULT_PROFILE" != "$SETTINGS_DIR/profile.default" ]; then
|
|
||||||
logg info "Renaming $DEFAULT_PROFILE to $SETTINGS_DIR/profile.default"
|
|
||||||
rsync -a "$DEFAULT_PROFILE/" "$SETTINGS_DIR/profile.default"
|
|
||||||
fi
|
|
||||||
if [ -n "$DEFAULT_RELEASE_PROFILE" ]; then
|
if [ -n "$DEFAULT_RELEASE_PROFILE" ]; then
|
||||||
logg info "Renaming $DEFAULT_RELEASE_PROFILE to $SETTINGS_DIR/profile.primary"
|
logg info "Renaming $DEFAULT_RELEASE_PROFILE to $SETTINGS_DIR/profile.default"
|
||||||
rsync -a "$DEFAULT_RELEASE_PROFILE/" "$SETTINGS_DIR/profile.primary"
|
rsync -a "$DEFAULT_RELEASE_PROFILE/" "$SETTINGS_DIR/profile.default"
|
||||||
fi
|
fi
|
||||||
if [ ! -d "$SETTINGS_DIR/profile.secondary" ] && [ -d "$SETTINGS_DIR/profile.default" ]; then
|
|
||||||
logg info 'Adding a secondary profile'
|
### Default profile w/ plugins installed (installation happens below)
|
||||||
rsync -a "$SETTINGS_DIR/profile.default/" "$SETTINGS_DIR/profile.secondary"
|
if [ -n "$DEFAULT_RELEASE_PROFILE" ]; then
|
||||||
|
logg info "Renaming $DEFAULT_RELEASE_PROFILE to $SETTINGS_DIR/profile.plugins"
|
||||||
|
rsync -a "$DEFAULT_RELEASE_PROFILE/" "$SETTINGS_DIR/profile.plugins"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
### Miscellaneous default profiles
|
||||||
|
for NEW_PROFILE in "automation" "development" "miscellaneous"; do
|
||||||
|
if [ ! -d "$SETTINGS_DIR/profile.${NEW_PROFILE}" ] && [ -d "$SETTINGS_DIR/profile.default" ]; then
|
||||||
|
logg info "Cloning $NEW_PROFILE from profile.default"
|
||||||
|
rsync -a "$SETTINGS_DIR/profile.default/" "$SETTINGS_DIR/profile.${NEW_PROFILE}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
### Public git profile
|
||||||
|
if [ -d "$SETTINGS_DIR/profile.git" ]; then
|
||||||
|
logg info 'Resetting the Firefox git profile'
|
||||||
|
cd "$SETTINGS_DIR/profile.git"
|
||||||
|
git reset --hard HEAD
|
||||||
|
git clean -fxd
|
||||||
|
logg info 'Pulling latest updates to the Firefox git profile'
|
||||||
|
git pull origin master
|
||||||
|
else
|
||||||
|
logg info 'Cloning the public Firefox git profile'
|
||||||
|
cd "$SETTINGS_DIR"
|
||||||
|
git clone {{ .firefoxPublicProfile }} profile.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
### Private hosted profile
|
||||||
|
if [ ! -d "$SETTINGS_DIR/profile.private" ]; then
|
||||||
|
logg info 'Downloading the encrypted Firefox private profile'
|
||||||
|
curl -sSL '{{ .firefoxPrivateProfile }}' -o profile.private.tar.gz.age
|
||||||
|
logg info 'Decrypting the Firefox private profile'
|
||||||
|
chezmoi decrypt profile.private.tar.gz.age > profile.private.tar.gz
|
||||||
|
rm -f profile.private.tar.gz.age
|
||||||
|
logg info 'Decompressing the Firefox private profile'
|
||||||
|
tar -xzf profile.private.tar.gz
|
||||||
|
logg success 'The Firefox private profile was successfully installed'
|
||||||
|
fi
|
||||||
|
|
||||||
|
### Add the populated profiles.ini
|
||||||
logg info "Copying "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/profiles.ini" to profile directory"
|
logg info "Copying "${XDG_DATA_HOME:-$HOME/.local/share}/firefox/profiles.ini" to profile directory"
|
||||||
if [ -d /Applications ] && [ -d /System ]; then
|
if [ -d /Applications ] && [ -d /System ]; then
|
||||||
# macOS
|
# macOS
|
||||||
|
@ -190,12 +227,12 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app
|
||||||
PLUGIN_URL="$(cat "$PLUGIN_HTML" | htmlq '.InstallButtonWrapper-download-link' --attribute href)"
|
PLUGIN_URL="$(cat "$PLUGIN_HTML" | htmlq '.InstallButtonWrapper-download-link' --attribute href)"
|
||||||
PLUGIN_FILENAME="${PLUGIN_FILE_ID}.xpi"
|
PLUGIN_FILENAME="${PLUGIN_FILE_ID}.xpi"
|
||||||
PLUGIN_FOLDER="$(echo "$PLUGIN_FILENAME" | sed 's/.xpi$//')"
|
PLUGIN_FOLDER="$(echo "$PLUGIN_FILENAME" | sed 's/.xpi$//')"
|
||||||
if [ ! -d "$SETTINGS_DIR/profile.primary/extensions/$PLUGIN_FOLDER" ]; then
|
if [ ! -d "$SETTINGS_DIR/profile.plugins/extensions/$PLUGIN_FOLDER" ]; then
|
||||||
logg info 'Downloading plugin file for '"$PLUGIN_FILENAME"' ('"$FIREFOX_PLUGIN"')'
|
logg info 'Downloading plugin file for '"$PLUGIN_FILENAME"' ('"$FIREFOX_PLUGIN"')'
|
||||||
if [ ! -d "$SETTINGS_DIR/profile.primary/extensions" ]; then
|
if [ ! -d "$SETTINGS_DIR/profile.plugins/extensions" ]; then
|
||||||
mkdir -p "$SETTINGS_DIR/profile.primary/extensions"
|
mkdir -p "$SETTINGS_DIR/profile.plugins/extensions"
|
||||||
fi
|
fi
|
||||||
curl -sSL "$PLUGIN_URL" -o "$SETTINGS_DIR/profile.primary/extensions/$PLUGIN_FILENAME"
|
curl -sSL "$PLUGIN_URL" -o "$SETTINGS_DIR/profile.plugins/extensions/$PLUGIN_FILENAME"
|
||||||
# Unzipping like this causes Firefox to complain about unsigned plugins
|
# Unzipping like this causes Firefox to complain about unsigned plugins
|
||||||
# TODO - figure out how to headlessly enable the extensions in such a way that is compatible with Flatpak / Snap
|
# TODO - figure out how to headlessly enable the extensions in such a way that is compatible with Flatpak / Snap
|
||||||
# using the /usr/lib/firefox/distribution/policies.json works but this is not compatible with Flatpak / Snap out of the box
|
# using the /usr/lib/firefox/distribution/policies.json works but this is not compatible with Flatpak / Snap out of the box
|
||||||
|
@ -203,7 +240,7 @@ for SETTINGS_DIR in "$HOME/snap/firefox/common/.mozilla/firefox" "$HOME/.var/app
|
||||||
# all Firefox profiles to use the same extensions. Ideally, we should find a way to enable the extensions scoped
|
# all Firefox profiles to use the same extensions. Ideally, we should find a way to enable the extensions scoped
|
||||||
# to the user profile.
|
# to the user profile.
|
||||||
# logg info 'Unzipping '"$PLUGIN_FILENAME"' ('"$FIREFOX_PLUGIN"')'
|
# logg info 'Unzipping '"$PLUGIN_FILENAME"' ('"$FIREFOX_PLUGIN"')'
|
||||||
# unzip "$SETTINGS_DIR/profile.primary/extensions/$PLUGIN_FILENAME" -d "$SETTINGS_DIR/profile.primary/extensions/$PLUGIN_FOLDER"
|
# unzip "$SETTINGS_DIR/profile.plugins/extensions/$PLUGIN_FILENAME" -d "$SETTINGS_DIR/profile.primary/extensions/$PLUGIN_FOLDER"
|
||||||
logg success 'Installed `'"$FIREFOX_PLUGIN"'`'
|
logg success 'Installed `'"$FIREFOX_PLUGIN"'`'
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
11
home/dot_config/firefoxprofileswitcher/avatars.json
Normal file
11
home/dot_config/firefoxprofileswitcher/avatars.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"avatars": {
|
||||||
|
"0B803C3C78AB69A7FA2B43EDF4F139C60B16081EE3C8B4F98FAF07D2EA236505": "res:/img/avatars/modern_cros_200/abstract/avatar_melon.png",
|
||||||
|
"43D07063950E4B54FE593B7C6DF3BC64ADAA374A1BBFA885CDFC04C7A3C8072A": "res:/img/avatars/modern_cros_200/abstract/avatar_pizza.png",
|
||||||
|
"A9D6FA4B7A2043B7FB3EDCB95FEDCC8B137DF5821357CF76ADB6B29B5B3E558A": "res:/img/avatars/modern_cros_200/abstract/avatar_sandwich.png",
|
||||||
|
"E098B8A5E8AD32E45AFFE798EBA7067D889111E9D57D92FA01046EF0AFCB1CCA": "res:/img/avatars/modern_cros_200/abstract/avatar_icewater.png",
|
||||||
|
"2E72B43D0149045B0A028448C9D10BD55F961857D1AD7F758BE71CB87539E787": "res:/img/avatars/modern_cros_200/illustration/avatar_cheese.png",
|
||||||
|
"1D24BBDF1FB63F9785102F65138E17B1EE8C8531856791F6646A3C75F9B3F852": "res:/img/avatars/modern_cros_200/illustration/avatar_basketball.png",
|
||||||
|
"4C1004A5D052D0ED7B120AC39DFD6F33EAD3EA7EAC047B9DD4F8AEF91232BE51": "res:/img/avatars/modern_cros_200/abstract/avatar_avocado.png"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"windowFocusWorkaround": false,
|
||||||
|
"darkMode": true
|
||||||
|
}
|
11
home/dot_config/firefoxprofileswitcher/profile-options.json
Normal file
11
home/dot_config/firefoxprofileswitcher/profile-options.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"options": {
|
||||||
|
"E098B8A5E8AD32E45AFFE798EBA7067D889111E9D57D92FA01046EF0AFCB1CCA": {},
|
||||||
|
"2E72B43D0149045B0A028448C9D10BD55F961857D1AD7F758BE71CB87539E787": {},
|
||||||
|
"0B803C3C78AB69A7FA2B43EDF4F139C60B16081EE3C8B4F98FAF07D2EA236505": {},
|
||||||
|
"43D07063950E4B54FE593B7C6DF3BC64ADAA374A1BBFA885CDFC04C7A3C8072A": {},
|
||||||
|
"1D24BBDF1FB63F9785102F65138E17B1EE8C8531856791F6646A3C75F9B3F852": {},
|
||||||
|
"A9D6FA4B7A2043B7FB3EDCB95FEDCC8B137DF5821357CF76ADB6B29B5B3E558A": {},
|
||||||
|
"4C1004A5D052D0ED7B120AC39DFD6F33EAD3EA7EAC047B9DD4F8AEF91232BE51": {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,10 +27,6 @@
|
||||||
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/clearurls/latest.xpi",
|
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/clearurls/latest.xpi",
|
||||||
"installation_mode": "normal_installed"
|
"installation_mode": "normal_installed"
|
||||||
},
|
},
|
||||||
"CookieAutoDelete@kennydo.com": {
|
|
||||||
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/cookie-autodelete/latest.xpi",
|
|
||||||
"installation_mode": "normal_installed"
|
|
||||||
},
|
|
||||||
"Decentraleyes@ThomasRientjes": {
|
"Decentraleyes@ThomasRientjes": {
|
||||||
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi",
|
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi",
|
||||||
"installation_mode": "normal_installed"
|
"installation_mode": "normal_installed"
|
||||||
|
@ -43,14 +39,6 @@
|
||||||
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/temporary-containers/latest.xpi",
|
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/temporary-containers/latest.xpi",
|
||||||
"installation_mode": "normal_installed"
|
"installation_mode": "normal_installed"
|
||||||
},
|
},
|
||||||
"https-everywhere@eff.org": {
|
|
||||||
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/https-everywhere/latest.xpi",
|
|
||||||
"installation_mode": "normal_installed"
|
|
||||||
},
|
|
||||||
"jid1-MnnxcxisBPnSXQ@jetpack": {
|
|
||||||
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi",
|
|
||||||
"installation_mode": "normal_installed"
|
|
||||||
},
|
|
||||||
"uBlock0@raymondhill.net": {
|
"uBlock0@raymondhill.net": {
|
||||||
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi",
|
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi",
|
||||||
"installation_mode": "normal_installed"
|
"installation_mode": "normal_installed"
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
[Profile3]
|
||||||
|
Name=Development
|
||||||
|
IsRelative=1
|
||||||
|
Path={{ if eq .host.distro.family "darwin" }}Profiles/{{ end }}profile.development
|
||||||
|
|
||||||
[Profile2]
|
[Profile2]
|
||||||
Name=Secondary
|
Name=Secondary
|
||||||
IsRelative=1
|
IsRelative=1
|
||||||
|
|
Loading…
Reference in a new issue