From 08f39fc10c2864dd265d2da25d364e59fdbb51dd Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Tue, 10 Jan 2023 00:06:45 +0000 Subject: [PATCH] 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 --- home/.chezmoidata.yaml | 1 + ...change_after_21-import-dconf-settings.tmpl | 29 +++++++++++++++++++ .../bin/executable_backup-dconf.tmpl | 27 +++++++++++++++++ home/dot_local/bin/executable_install-program | 2 +- .../settings/org.gnome.desktop.app-folders | 0 .../settings/org.gnome.desktop.applications | 0 .../settings/org.gnome.desktop.background | 0 .../dconf/settings/org.gnome.desktop.calendar | 0 .../settings/org.gnome.desktop.interface | 0 .../dconf/settings/org.gnome.desktop.privacy | 0 .../dconf/settings/org.gnome.desktop.session | 0 .../dconf/settings/org.gnome.desktop.sound | 0 .../settings/org.gnome.desktop.wm.preferences | 0 .../org.gnome.settings-daemon.plugins.power | 0 .../dconf/settings/org.gnome.shell | 0 .../dconf/settings/system.proxy | 0 software.yml | 13 +++++++-- 17 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 home/.chezmoiscripts/universal/run_onchange_after_21-import-dconf-settings.tmpl create mode 100644 home/dot_local/bin/executable_backup-dconf.tmpl create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.app-folders create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.applications create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.background create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.calendar create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.interface create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.privacy create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.session create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.sound create mode 100644 home/private_dot_config/dconf/settings/org.gnome.desktop.wm.preferences create mode 100644 home/private_dot_config/dconf/settings/org.gnome.settings-daemon.plugins.power create mode 100644 home/private_dot_config/dconf/settings/org.gnome.shell create mode 100644 home/private_dot_config/dconf/settings/system.proxy 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"'