Maintain a local list of unavailable extensions
This commit is contained in:
parent
67d7b4a0b5
commit
b2c731f6ac
|
@ -114,8 +114,6 @@ function dconf-clean {
|
||||||
|
|
||||||
function dconf-dump {
|
function dconf-dump {
|
||||||
dconf dump / > "$HOME/.dconf-dump.tmp"
|
dconf dump / > "$HOME/.dconf-dump.tmp"
|
||||||
dconf-clean "$HOME/.dconf-dump.tmp"
|
|
||||||
rm "$HOME/.dconf-dump.tmp"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function push-dconf {
|
function push-dconf {
|
||||||
|
@ -167,13 +165,17 @@ function load-extensions {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
scp -P 11275 'sage@sagev.space:~/gnome-extension-list' $HOME/.tmp/gnome-extension-list
|
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
|
for ext in $(cat $HOME/.tmp/gnome-extension-list); do
|
||||||
if grep "$ext" <(echo $existing) &> /dev/null; then
|
if grep "$ext" <(echo $existing) &> /dev/null; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
VERSION_TAG=$(curl -Lfs "https://extensions.gnome.org/extension-query/?search=${ext}" | jq '.extensions[0] | .shell_version_map | map(.pk) | max')
|
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
|
gnome-extensions install --force ${EXTENSION_ID}.zip
|
||||||
if ! gnome-extensions list | grep --quiet ${ext}; then
|
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}
|
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
|
export nvm_loaded=false
|
||||||
|
|
||||||
alias nvm="load_nvm; nvm"
|
alias nvm="load_nvm; nvm"
|
||||||
|
alias npm="load_nvm; npm"
|
||||||
alias node="load_nvm; node"
|
alias node="load_nvm; node"
|
||||||
|
|
||||||
function load_nvm {
|
function load_nvm {
|
||||||
|
|
Loading…
Reference in New Issue