Ensure all gnome-extensions are available and enabled

This commit is contained in:
Manuel Thalmann 2022-11-14 23:14:39 +01:00
parent 5b46f1fda5
commit c2405e47b4

View file

@ -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