Maintain a local list of unavailable extensions

This commit is contained in:
Sage Vaillancourt 2024-05-14 09:06:04 -04:00
parent 67d7b4a0b5
commit b2c731f6ac
1 changed files with 7 additions and 4 deletions

View File

@ -114,8 +114,6 @@ function dconf-clean {
function dconf-dump {
dconf dump / > "$HOME/.dconf-dump.tmp"
dconf-clean "$HOME/.dconf-dump.tmp"
rm "$HOME/.dconf-dump.tmp"
}
function push-dconf {
@ -167,13 +165,17 @@ function load-extensions {
return
fi
scp -P 11275 'sage@sagev.space:~/gnome-extension-list' $HOME/.tmp/gnome-extension-list
local existing="$(gnome-extensions list)"
touch "$HOME/.unavailable-extensions"
local existing="$(cat <(gnome-extensions list) "$HOME/.unavailable-extensions")"
for ext in $(cat $HOME/.tmp/gnome-extension-list); do
if grep "$ext" <(echo $existing) &> /dev/null; then
continue
fi
VERSION_TAG=$(curl -Lfs "https://extensions.gnome.org/extension-query/?search=${ext}" | jq '.extensions[0] | .shell_version_map | map(.pk) | max')
wget -O ${ext}.zip "https://extensions.gnome.org/download-extension/${ext}.shell-extension.zip?version_tag=$VERSION_TAG" || continue
if ! wget -O ${ext}.zip "https://extensions.gnome.org/download-extension/${ext}.shell-extension.zip?version_tag=$VERSION_TAG"; then
echo "$ext" >> "$HOME/.unavailable-extensions"
continue
fi
gnome-extensions install --force ${EXTENSION_ID}.zip
if ! gnome-extensions list | grep --quiet ${ext}; then
busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s ${ext}
@ -256,6 +258,7 @@ fi
export nvm_loaded=false
alias nvm="load_nvm; nvm"
alias npm="load_nvm; npm"
alias node="load_nvm; node"
function load_nvm {