From 49ccb01787ab5f8d214c5272e8f68fa693efe037 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sat, 18 May 2024 13:38:40 -0400 Subject: [PATCH] More comprehensive failed-extension storage --- fake_home/.zshrc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 3a7d846..176465f 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -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 }