Use $HOME/.tmp instead of /tmp
Works better with termux, etc
This commit is contained in:
parent
f09a1ae032
commit
aba727e205
|
@ -113,8 +113,8 @@ 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
|
||||||
dconf-dump > /tmp/dconf-dump || return 1
|
dconf-dump > $HOME/.tmp/dconf-dump || return 1
|
||||||
scp -P 11275 /tmp/dconf-dump 'sage@sagev.space:~/dconf-dump'
|
scp -P 11275 $HOME/.tmp/dconf-dump 'sage@sagev.space:~/dconf-dump'
|
||||||
}
|
}
|
||||||
|
|
||||||
function push-extensions {
|
function push-extensions {
|
||||||
|
@ -122,13 +122,13 @@ function push-extensions {
|
||||||
echo "gnome-extensions is not installed!"
|
echo "gnome-extensions is not installed!"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
mv /tmp/gnome-extension-list /tmp/prev-gnome-extension-list &> /dev/null
|
mv $HOME/.tmp/gnome-extension-list $HOME/.tmp/prev-gnome-extension-list &> /dev/null
|
||||||
gnome-extensions list > /tmp/gnome-extension-list
|
gnome-extensions list > $HOME/.tmp/gnome-extension-list
|
||||||
# If there is NO difference, skip scp
|
# If there is NO difference, skip scp
|
||||||
if [[ "$1" != "--force" ]] && diff /tmp/gnome-extension-list /tmp/prev-gnome-extension-list &> /dev/null; then
|
if [[ "$1" != "--force" ]] && diff $HOME/.tmp/gnome-extension-list $HOME/.tmp/prev-gnome-extension-list &> /dev/null; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
scp -P 11275 /tmp/gnome-extension-list 'sage@sagev.space:~/gnome-extension-list'
|
scp -P 11275 $HOME/.tmp/gnome-extension-list 'sage@sagev.space:~/gnome-extension-list'
|
||||||
}
|
}
|
||||||
|
|
||||||
function merge-hist {
|
function merge-hist {
|
||||||
|
@ -136,12 +136,12 @@ function merge-hist {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sync-history {
|
function sync-history {
|
||||||
if ! scp -P 11275 'sage@sagev.space:~/histfile' "/tmp/.histfile"; then
|
if ! scp -P 11275 'sage@sagev.space:~/histfile' "$HOME/.tmp/.histfile"; then
|
||||||
scp -P 11275 "$HOME/.histfile" 'sage@sagev.space:~/histfile'
|
scp -P 11275 "$HOME/.histfile" 'sage@sagev.space:~/histfile'
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
merge-hist "$HOME/.histfile" "/tmp/.histfile" > "/tmp/$(whoami).histfile"
|
merge-hist "$HOME/.histfile" "$HOME/.tmp/.histfile" > "$HOME/.tmp/$(whoami).histfile"
|
||||||
mv "/tmp/$(whoami).histfile" "$HOME/.histfile"
|
mv "$HOME/.tmp/$(whoami).histfile" "$HOME/.histfile"
|
||||||
scp -P 11275 "$HOME/.histfile" 'sage@sagev.space:~/histfile'
|
scp -P 11275 "$HOME/.histfile" 'sage@sagev.space:~/histfile'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,9 +150,9 @@ function load-extensions {
|
||||||
echo "gnome-extensions is not installed!"
|
echo "gnome-extensions is not installed!"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
scp -P 11275 'sage@sagev.space:~/gnome-extension-list' /tmp/gnome-extension-list
|
scp -P 11275 'sage@sagev.space:~/gnome-extension-list' $HOME/.tmp/gnome-extension-list
|
||||||
local existing="$(gnome-extensions list)"
|
local existing="$(gnome-extensions list)"
|
||||||
for ext in $(cat /tmp/gnome-extension-list); do
|
for ext in $(cat $HOME/.tmp/gnome-extension-list); do
|
||||||
if grep "$ext" <(echo $existing) &> /dev/null; then
|
if grep "$ext" <(echo $existing) &> /dev/null; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
@ -189,19 +189,19 @@ function sync-dconf {
|
||||||
echo "System does not use dconf"
|
echo "System does not use dconf"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
rm /tmp/dconf-dump &> /dev/null
|
rm $HOME/.tmp/dconf-dump &> /dev/null
|
||||||
scp -P 11275 'sage@sagev.space:~/dconf-dump' /tmp/dconf-dump
|
scp -P 11275 'sage@sagev.space:~/dconf-dump' $HOME/.tmp/dconf-dump
|
||||||
dconf-dump > /tmp/current-dconf-dump
|
dconf-dump > $HOME/.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 $HOME/.tmp/current-dconf-dump $HOME/.tmp/dconf-dump &> /dev/null; then
|
||||||
echo
|
echo
|
||||||
echo "Incoming conf changes:"
|
echo "Incoming conf changes:"
|
||||||
echo
|
echo
|
||||||
git --no-pager diff --no-index /tmp/current-dconf-dump /tmp/dconf-dump
|
git --no-pager diff --no-index $HOME/.tmp/current-dconf-dump $HOME/.tmp/dconf-dump
|
||||||
echo
|
echo
|
||||||
bash -c 'read -p "Press enter to continue, or Ctrl-C to cancel."' || return 1
|
bash -c 'read -p "Press enter to continue, or Ctrl-C to cancel."' || return 1
|
||||||
echo "Applying changes..."
|
echo "Applying changes..."
|
||||||
fi
|
fi
|
||||||
dconf load / < /tmp/dconf-dump || return 1
|
dconf load / < $HOME/.tmp/dconf-dump || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function getdot {
|
function getdot {
|
||||||
|
@ -227,7 +227,7 @@ if which starship &> /dev/null; then
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
last_get_file="/tmp/.$(whoami)-dotfiles-last-get"
|
last_get_file="$HOME/.tmp/.$(whoami)-dotfiles-last-get"
|
||||||
current_date="$(date '+%Y-%m-%d')"
|
current_date="$(date '+%Y-%m-%d')"
|
||||||
if test -d "$DOT_DIR" && [[ "$current_date" != "$(cat "$last_get_file")" ]] &> /dev/null; then
|
if test -d "$DOT_DIR" && [[ "$current_date" != "$(cat "$last_get_file")" ]] &> /dev/null; then
|
||||||
echo "$current_date" > "$last_get_file"
|
echo "$current_date" > "$last_get_file"
|
||||||
|
|
Loading…
Reference in New Issue