More comprehensive failed-extension storage

This commit is contained in:
Sage Vaillancourt 2024-05-18 13:38:40 -04:00
parent b2c731f6ac
commit 49ccb01787
1 changed files with 17 additions and 5 deletions

View File

@ -159,6 +159,20 @@ function sync-history {
fc -R # Read from new history file
}
function install-extension {
local ext="$1"
local file="$1.zip"
if ! gnome-extensions install --force ${ext}.zip; then
return 1
fi
if ! gnome-extensions list | grep --quiet ${ext}; then
if ! busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s ${ext}; then
return 1
fi
fi
gnome-extensions enable ${ext}
}
function load-extensions {
if ! command -v gnome-extensions &> /dev/null; then
echo "gnome-extensions is not installed!"
@ -176,12 +190,10 @@ function load-extensions {
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}
if ! install-extension "$ext"; then
echo "$ext" >> "$HOME/.unavailable-extensions"
fi
gnome-extensions enable ${ext}
rm ${EXTENSION_ID}.zip
rm ${ext}.zip
done
}