install.fairie/home/.chezmoiscripts/universal/run_onchange_after_21-import-dconf-settings.tmpl
Brian Zalewski 08f39fc10c Update 17 files
- /software.yml
- /home/.chezmoidata.yaml
- /home/private_dot_config/dconf/settings/org.gnome.desktop.applications
- /home/private_dot_config/dconf/settings/org.gnome.desktop.background
- /home/private_dot_config/dconf/settings/org.gnome.desktop.calendar
- /home/private_dot_config/dconf/settings/org.gnome.desktop.interface
- /home/private_dot_config/dconf/settings/org.gnome.desktop.privacy
- /home/private_dot_config/dconf/settings/org.gnome.desktop.session
- /home/private_dot_config/dconf/settings/org.gnome.desktop.sound
- /home/private_dot_config/dconf/settings/org.gnome.desktop.wm.preferences
- /home/private_dot_config/dconf/settings/org.gnome.settings-daemon.plugins.power
- /home/private_dot_config/dconf/settings/org.gnome.shell
- /home/private_dot_config/dconf/settings/system.proxy
- /home/private_dot_config/dconf/settings/org.gnome.desktop.app-folders
- /home/.chezmoiscripts/universal/run_onchange_after_21-import-dconf-settings.tmpl
- /home/dot_local/bin/executable_backup-dconf.tmpl
- /home/dot_local/bin/executable_install-program
2023-01-10 00:06:45 +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 -}}