diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index e4855c4b..0824dfce 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -553,6 +553,7 @@ softwareGroups: - envchain - envconsul - pony + - protonvpn-cli - skate - ssh-vault - stubby diff --git a/home/.chezmoiscripts/universal/run_onchange_after_21-import-dconf-settings.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_21-import-dconf-settings.tmpl new file mode 100644 index 00000000..7186b9af --- /dev/null +++ b/home/.chezmoiscripts/universal/run_onchange_after_21-import-dconf-settings.tmpl @@ -0,0 +1,29 @@ +{{- 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 -}} diff --git a/home/dot_local/bin/executable_backup-dconf.tmpl b/home/dot_local/bin/executable_backup-dconf.tmpl new file mode 100644 index 00000000..552e7846 --- /dev/null +++ b/home/dot_local/bin/executable_backup-dconf.tmpl @@ -0,0 +1,27 @@ +{{- if eq .host.distro.family "linux" -}} +#!/usr/bin/env bash + +{{ includeTemplate "universal/profile" }} +{{ includeTemplate "universal/logg" }} + +### Create backups +if [ -d "$XDG_CONFIG_HOME/dconf/settings" ]; then + DCONF_TMP="$(mktemp)" + logg info 'Moving ~/.config/dconf/settings to '"$DCONF_TMP" + mv "$XDG_CONFIG_HOME/dconf/settings" "$DCONF_TMP" +fi + +### Ensure ~/.config/dconf/settings exists +mkdir -p "$XDG_CONFIG_HOME/dconf/settings" + +### Overwrite ~/.config/dconf/settings configurations so we can diff with Chezmoi +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/\./\//')/" + logg info 'Dumping `'"$DCONF_SETTINGS_ID"'` to '"$DCONF_CONFIG_FILE" + dconf dump "$DCONF_SETTINGS_ID" > "$DCONF_CONFIG_FILE" + logg success 'Saved new configuration to '"$DCONF_CONFIG_FILE" + logg info 'Printing diff for '"$DCONF_CONFIG_FILE" + chezmoi diff "$DCONF_CONFIG_FILE" +done + +{{ end -}} diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index 4b7f86f1..0995cb98 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -1146,7 +1146,7 @@ async function installPackageList(packageManager, packages) { if (unbuffer) { unbufferPrefix = 'unbuffer' } - const verboseMode = process.env.DEBUG_MODE === 'on' ? 'vv' : '' + const verboseMode = process.env.DEBUG_MODE === 'true' ? 'vv' : '' if (osPlatform === 'darwin' || osPlatform === 'linux' || osPlatform === 'windows') { await $`ANSIBLE_CONFIG=${process.env.HOME}/.local/share/ansible/ansible.cfg ansible 127.0.0.1 -v${verboseMode} -e '{ ansible_connection: "local", ansible_become_user: "root", ansible_user: "${process.env.USER}", ansible_family: "${osPlatform}", install_homebrew: False }' -m include_role -a name=${pkg}` log('success', 'Install', `${pkg} successfully installed via ${packageManager}`) diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.app-folders b/home/private_dot_config/dconf/settings/org.gnome.desktop.app-folders new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.applications b/home/private_dot_config/dconf/settings/org.gnome.desktop.applications new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.background b/home/private_dot_config/dconf/settings/org.gnome.desktop.background new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.calendar b/home/private_dot_config/dconf/settings/org.gnome.desktop.calendar new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.interface b/home/private_dot_config/dconf/settings/org.gnome.desktop.interface new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.privacy b/home/private_dot_config/dconf/settings/org.gnome.desktop.privacy new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.session b/home/private_dot_config/dconf/settings/org.gnome.desktop.session new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.sound b/home/private_dot_config/dconf/settings/org.gnome.desktop.sound new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.desktop.wm.preferences b/home/private_dot_config/dconf/settings/org.gnome.desktop.wm.preferences new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.settings-daemon.plugins.power b/home/private_dot_config/dconf/settings/org.gnome.settings-daemon.plugins.power new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/org.gnome.shell b/home/private_dot_config/dconf/settings/org.gnome.shell new file mode 100644 index 00000000..e69de29b diff --git a/home/private_dot_config/dconf/settings/system.proxy b/home/private_dot_config/dconf/settings/system.proxy new file mode 100644 index 00000000..e69de29b diff --git a/software.yml b/software.yml index 8d1e3f93..c988d32f 100644 --- a/software.yml +++ b/software.yml @@ -5173,18 +5173,25 @@ softwarePackages: scoop: procs snap: procs protonvpn: - _bin: null + _bin: protonvpn _desc: '[Proton](https://www.proton.org/) is a free and open-source raster graphics editor used for image manipulation and image editing, free-form drawing, transcoding between different image file formats, and more specialized tasks. Proton is released under GPLv3+ license and is available for Linux, macOS, and Microsoft Windows.' _docs: https://protonmail.com/support/ _github: https://github.com/ProtonMail/WebClients _home: https://protonmail.com/ - _name: Proton + _name: ProtonVPN _when:cask: '! test -d /Applications/ProtonVPN.app' ansible: professormanhattan.proton cask: protonvpn choco: protonvpn - dnf: protonvpn-cli yay: protonvpn + protonvpn-cli: + _bin: protonvpn-cli + _desc: null + _docs: null + _github: null + _home: null + _name: ProtonVPN CLI + _todo: Populate this once the ProtonVPN CLI is released to the package managers protonmail-bridge: _bin: protonmail-bridge _when:cask: '! test -d "/Applications/Proton Mail Bridge.app"'