install.fairie/home/.chezmoiscripts/universal/run_onchange_after_21-dconf-settings.tmpl
Brian Zalewski 2d743be3bb Update 19 files
- /system/usr/local/share/run_onchange_after_setup-share-folder
- /system/var/log/user/run_onchange_after-symlink-user-logs
- /system/usr/share/run_onchange_after_setup-share-folder
- /system/etc/default/modify_grub
- /system/boot/efi/EFI/qubes/modify_grubenv
- /home/.chezmoiscripts/universal/run_onchange_after_14_install-aqua-packages.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_21-import-dconf-settings.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_20-apply-settings.mjs.tmpl
- /system/usr/local/bin/executable_squash-symlink
- /system/etc/modify_environment
- /home/.chezmoiscripts/universal/run_onchange_after_19-theme-files.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_14_install-aqua-packages.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_21-dconf-settings.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_20-misc-settings.mjs.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_5-log-config.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_4-environment-profile.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_60-grub-settings.tmpl
- /home/dot_local/bin/executable_rclone-mount
- /home/.chezmoidata.yaml
2023-01-10 07:09:18 +00:00

29 lines
1.2 KiB
Cheetah

{{- if eq .host.distro.family "linux" -}}
#!/usr/bin/env bash
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
### Backup system settings
DCONF_TMP="$(mktemp)"
dconf dump / > "$DCONF_TMP"
logg info 'Backed up system dconf settings to '"$DCONF_TMP"
### Reset system settings / load saved configurations from ~/.config/dconf/settings
if [ -d "$XDG_CONFIG_HOME/dconf/settings" ]; then
find "$XDG_CONFIG_HOME/dconf/settings" -mindepth 1 -maxdepth 1 -type f | while read DCONF_CONFIG_FILE; do
DCONF_SETTINGS_ID="/$(basename "$DCONF_CONFIG_FILE" | sed 's/\./\//')"
# Reset dconf settings if environment variable RESET_DCONF is set to true
if [ "$RESET_DCONF" == 'true' ]; then
logg info 'Resetting dconf settings for `'"$DCONF_SETTINGS_ID"'`'
dconf reset -f "$DCONF_SETTINGS_ID"
fi
logg info 'Loading versioned dconf settings for `'"$DCONF_SETTINGS_ID"'`'
dconf load "$DCONF_SETTINGS_ID" < "$DCONF_CONFIG_FILE"
logg success 'Finished applying dconf settings for `'"$DCONF_SETTINGS_ID"'`'
done
else
logg warn '~/.config/dconf/settings does not exist!'
fi
{{ end -}}