diff --git a/scripts/PopOS/software/gnome-extensions.sh b/scripts/PopOS/software/gnome-extensions.sh index b19f4f55..5309a9f4 100755 --- a/scripts/PopOS/software/gnome-extensions.sh +++ b/scripts/PopOS/software/gnome-extensions.sh @@ -1,21 +1,33 @@ #!/bin/bash -# Elevate script -if [ ! "$UID" -eq 0 ] -then - sudo bash "$BASH_SOURCE" -else - commandName=gnome-shell-extension-installer +commandName=gnome-shell-extension-installer +extensionLocation=/usr/share/gnome-shell/extensions +workingDirectory=$(pwd) +contextRoot=$(mktemp -d) +cd "$contextRoot" + +wget -O "$commandName" "https://github.com/brunelli/gnome-shell-extension-installer/raw/master/gnome-shell-extension-installer" +sudo install "$commandName" /usr/local/bin + +cd "$workingDirectory" +rm -rf "$contextRoot" + +for id in 779 4907 +do workingDirectory=$(pwd) contextRoot=$(mktemp -d) - cd $contextRoot + unzipLocation=$(mktemp -d) + cd "$contextRoot" - wget -O $commandName "https://github.com/brunelli/gnome-shell-extension-installer/raw/master/gnome-shell-extension-installer" - install $commandName /usr/local/bin + gnome-shell-extension-installer $id --no-install + sudo gnome-shell-extension-installer $id --yes + unzip ./*.zip -d "$unzipLocation" + uuid=$(jq -r '.uuid' "$unzipLocation/metadata.json") - cd $workingDirectory - rm -rf $contextRoot + sudo chmod -R +r "$extensionLocation/$uuid" + gnome-extensions enable "$uuid" - gnome-shell-extension-installer 779 --yes - gnome-shell-extension-installer 4907 --yes - killall -SIGQUIT gnome-shell -fi + cd "$workingDirectory" + rm -rf "$contextRoot" +done + +killall -SIGQUIT gnome-shell