Add sync-history
This commit is contained in:
parent
b35022a684
commit
b0bc85b327
|
@ -127,6 +127,17 @@ function push-extensions {
|
||||||
scp -P 11275 /tmp/gnome-extension-list 'sage@sagev.space:~/gnome-extension-list'
|
scp -P 11275 /tmp/gnome-extension-list 'sage@sagev.space:~/gnome-extension-list'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function merge-hist {
|
||||||
|
\diff --unified=9999999999999999 "$1" "$2" | tail -n +4 | sed 's/^.//'
|
||||||
|
}
|
||||||
|
|
||||||
|
function sync-history {
|
||||||
|
scp -P 11275 'sage@sagev.space:~/histfile' "/tmp/.histfile"
|
||||||
|
merge-hist "$HOME/.histfile" "/tmp/.histfile" > "/tmp/$(whoami).histfile"
|
||||||
|
mv "/tmp/$(whoami).histfile" "$HOME/.histfile"
|
||||||
|
scp -P 11275 "$HOME/.histfile" "/tmp/$(whoami).histfile"
|
||||||
|
}
|
||||||
|
|
||||||
function load-extensions {
|
function load-extensions {
|
||||||
if ! command -v gnome-extensions &> /dev/null; then
|
if ! command -v gnome-extensions &> /dev/null; then
|
||||||
echo "gnome-extensions is not installed!"
|
echo "gnome-extensions is not installed!"
|
||||||
|
@ -139,7 +150,7 @@ function load-extensions {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
VERSION_TAG=$(curl -Lfs "https://extensions.gnome.org/extension-query/?search=${ext}" | jq '.extensions[0] | .shell_version_map | map(.pk) | max')
|
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"
|
wget -O ${ext}.zip "https://extensions.gnome.org/download-extension/${ext}.shell-extension.zip?version_tag=$VERSION_TAG" || continue
|
||||||
gnome-extensions install --force ${EXTENSION_ID}.zip
|
gnome-extensions install --force ${EXTENSION_ID}.zip
|
||||||
if ! gnome-extensions list | grep --quiet ${ext}; then
|
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}
|
busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s ${ext}
|
||||||
|
@ -160,7 +171,7 @@ function pushdot {
|
||||||
res="$?"
|
res="$?"
|
||||||
fi
|
fi
|
||||||
if [[ "$res" == "0" ]]; then
|
if [[ "$res" == "0" ]]; then
|
||||||
git push -u origin main && push-extensions && push-dconf
|
git push -u origin main && push-extensions && sync-history && push-dconf
|
||||||
fi
|
fi
|
||||||
cd -
|
cd -
|
||||||
return $res
|
return $res
|
||||||
|
@ -173,7 +184,10 @@ function getdot {
|
||||||
fi
|
fi
|
||||||
cd "$DOT_DIR" || return 1
|
cd "$DOT_DIR" || return 1
|
||||||
git pull && ./copy.sh
|
git pull && ./copy.sh
|
||||||
|
|
||||||
load-extensions
|
load-extensions
|
||||||
|
sync-history
|
||||||
|
|
||||||
rm /tmp/dconf-dump &> /dev/null
|
rm /tmp/dconf-dump &> /dev/null
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue