Add load/push-extensions for gnome
This commit is contained in:
parent
5a7057a9bb
commit
14b3872e32
|
@ -109,21 +109,53 @@ function push-dconf {
|
||||||
echo "An alias for scpace has not been defined on this device!"
|
echo "An alias for scpace has not been defined on this device!"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
rm /tmp/dconf-dump &> /dev/null
|
|
||||||
dconf-dump > /tmp/dconf-dump || return 1
|
dconf-dump > /tmp/dconf-dump || return 1
|
||||||
scp -P 11275 /tmp/dconf-dump 'sage@sagev.space:~/dconf-dump'
|
scp -P 11275 /tmp/dconf-dump 'sage@sagev.space:~/dconf-dump'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function push-extensions {
|
||||||
|
if ! command -v gnome-extensions &> /dev/null; then
|
||||||
|
echo "gnome-extensions is not installed!"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
gnome-extensions list > /tmp/gnome-extension-list
|
||||||
|
scp -P 11275 /tmp/gnome-extension-list 'sage@sagev.space:~/gnome-extension-list'
|
||||||
|
}
|
||||||
|
|
||||||
|
function load-extensions {
|
||||||
|
if ! command -v gnome-extensions &> /dev/null; then
|
||||||
|
echo "gnome-extensions is not installed!"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
local existing="$(gnome-extensions list)"
|
||||||
|
for ext in $(cat /tmp/gnome-extension-list); do
|
||||||
|
if grep "$ext" <(echo $existing) &> /dev/null; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
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"
|
||||||
|
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}
|
||||||
|
fi
|
||||||
|
gnome-extensions enable ${ext}
|
||||||
|
rm ${EXTENSION_ID}.zip
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function pushdot {
|
function pushdot {
|
||||||
cd "$DOT_DIR" || return 1
|
cd "$DOT_DIR" || return 1
|
||||||
local res
|
local res
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
git commit -a && git push -u origin main && push-dconf
|
git commit -a
|
||||||
res="$?"
|
res="$?"
|
||||||
else
|
else
|
||||||
git commit -a -m "$@" && git push -u origin main && push-dconf
|
git commit -a -m "$@"
|
||||||
res="$?"
|
res="$?"
|
||||||
fi
|
fi
|
||||||
|
if [[ "$res" == "0" ]]; then
|
||||||
|
git push -u origin main && push-extensions && push-dconf
|
||||||
|
fi
|
||||||
cd -
|
cd -
|
||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
|
@ -136,6 +168,8 @@ function getdot {
|
||||||
cd "$DOT_DIR" || return 1
|
cd "$DOT_DIR" || return 1
|
||||||
git pull && ./copy.sh
|
git pull && ./copy.sh
|
||||||
rm /tmp/dconf-dump &> /dev/null
|
rm /tmp/dconf-dump &> /dev/null
|
||||||
|
scp -P 11275 'sage@sagev.space:~/gnome-extension-list' /tmp/gnome-extension-list
|
||||||
|
load-extensions
|
||||||
scp -P 11275 'sage@sagev.space:~/dconf-dump' /tmp/dconf-dump
|
scp -P 11275 'sage@sagev.space:~/dconf-dump' /tmp/dconf-dump
|
||||||
dconf-dump > /tmp/current-dconf-dump
|
dconf-dump > /tmp/current-dconf-dump
|
||||||
if ! git --no-pager diff --no-index /tmp/current-dconf-dump /tmp/dconf-dump &> /dev/null; then
|
if ! git --no-pager diff --no-index /tmp/current-dconf-dump /tmp/dconf-dump &> /dev/null; then
|
||||||
|
|
Loading…
Reference in New Issue