Do dconf cleaning on output AND input.

Add a few more ignored dconf sections.
Also, add uuid and vin aliases.
This commit is contained in:
Sage Vaillancourt 2024-04-25 08:55:30 -04:00
parent dc2b1ce01f
commit 67d7b4a0b5
2 changed files with 16 additions and 4 deletions

View File

@ -119,6 +119,8 @@ function undelete {
alias j='journalctl -xefu'
alias hsearch='hearch'
alias d='docker'
alias uuid='uuidgen'
alias vin='curl -s "http://randomvin.com/getvin.php?type=real"'
alias diff='diff -u'

View File

@ -75,11 +75,11 @@ fi
source ~/.shell_aliases
source ~/.zsh_local
function dconf-dump {
# Ignores certain values/sections that shouldn't be synced
function dconf-clean {
local current_section=""
local ignore_section=false
# Ignores certain values/sections that shouldn't be synced
dconf dump / | while read -r line; do
cat "$1" | while read -r line; do
if [[ "$line" == "["* ]]; then
current_section="$line"
ignore_section=false
@ -91,6 +91,9 @@ function dconf-dump {
case "$current_section" in
"[org/gnome/desktop/background]" | \
"[org/gnome/gedit/state/history-entry]" | \
"[org/gnome/gedit/plugins/filebrowser]" | \
"[org/gnome/desktop/notifications]" | \
"[org/gnome/cheese]" | \
"[org/gnome/shell/extensions/gsconnect"*)
ignore_section=true
;;
@ -109,6 +112,12 @@ function dconf-dump {
done
}
function dconf-dump {
dconf dump / > "$HOME/.dconf-dump.tmp"
dconf-clean "$HOME/.dconf-dump.tmp"
rm "$HOME/.dconf-dump.tmp"
}
function push-dconf {
if ! command -v dconf &> /dev/null; then
echo "The current system does not include dconf"
@ -202,7 +211,8 @@ function sync-dconf {
return
fi
rm $HOME/.tmp/dconf-dump &> /dev/null
scp -P 11275 'sage@sagev.space:~/dconf-dump' $HOME/.tmp/dconf-dump
scp -P 11275 'sage@sagev.space:~/dconf-dump' $HOME/.tmp/dconf-dump-inbound
dconf-clean $HOME/.tmp/dconf-dump-inbound > $HOME/.tmp/dconf-dump
dconf-dump > $HOME/.tmp/current-dconf-dump
if ! git --no-pager diff --no-index $HOME/.tmp/current-dconf-dump $HOME/.tmp/dconf-dump &> /dev/null; then
echo