Skip to content

Instantly share code, notes, and snippets.

@arter97
Created June 8, 2020 09:37
Show Gist options
  • Save arter97/47c70e6092f6c66f90d7b051ec425d92 to your computer and use it in GitHub Desktop.
Save arter97/47c70e6092f6c66f90d7b051ec425d92 to your computer and use it in GitHub Desktop.
dconf batch backup & restore (w/ meld)
dconf dump / | grep '^\[' | tr -d '\[' | tr -d '\]' |
while read a; do
(
dconf dump /$a/ |
sed -e 's@\[/\]@DUMMYPLACEHOLDER@g' |
sed -e '/DUMMYPLACEHOLDER/,$!d' |
tail -n+2 |
sed -e 's@^\[@DUMMYPLACEHOLDER@g' |
sed '/DUMMYPLACEHOLDER/,$d'; echo
) |
sort | sed '/^[[:space:]]*$/d' > $(echo $a | tr '/' '_')
done
ls | while read file; do
echo -n "["; echo -n $file | tr '_' '/'; echo "]"
cat $file
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment