From 218964ca2c09d592082f318d25e5327aabd53372 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Wed, 11 Jan 2023 23:41:09 +0000 Subject: [PATCH] Update 3 files - /home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_25-gnome-extension-settings.tmpl --- ...change_after_25-gnome-extension-settings.tmpl | 16 ++++++++-------- .../run_onchange_after_61-plymouth-settings.tmpl | 2 ++ .../run_onchange_after_64-grub-settings.tmpl | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_25-gnome-extension-settings.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_25-gnome-extension-settings.tmpl index 67e44ff8..04e67a12 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_25-gnome-extension-settings.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_25-gnome-extension-settings.tmpl @@ -15,9 +15,9 @@ fi ### Populate /tmp/install-gnome-extensions.txt with GNOME extensions that need to be installed if [ -f "$HOME/.config/desktop/gnome.yml" ]; then - cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' | jq -cr '.default_gnome_extensions[]' | while read EXT; do - EXT_URL="$(echo "$EXT" | jq -r '.url')" - EXT_ID="$(echo "$EXT" | jq -r '.regex')" + cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' | jq -cr '.default_gnome_extensions[] | tojson' | while read EXT; do + EXT_URL="$(echo "$EXT" | jq -nr '.url')" + EXT_ID="$(echo "$EXT" | jq -nr '.regex')" echo "$EXT_URL" >> /tmp/install-gnome-extensions.txt find "$XDG_DATA_DIR/gnome-shell/extensions" -mindepth 1 -maxdepth 1 -type d | while read EXT_FOLDER; do if [[ "$EXT_FOLDER" == "$EXT_REGEX"* ]]; then @@ -45,22 +45,22 @@ fi ### Apply plugin gsettings if [ -f "$HOME/.config/desktop/gnome.yml" ]; then - cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' | jq -cr '.default_gnome_extensions[]' | while read EXT; do + cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' | jq -cr '.default_gnome_extensions[] | tojson' | while read EXT; do if [ "$DEBUG_MODE" == 'true' ]; then logg info 'Extension data:' echo "$EXT" fi - EXT_ID="$(echo "$EXT" | jq -r '.regex')" + EXT_ID="$(echo "$EXT" | jq -nr '.regex')" if [ "$DEBUG_MODE" == 'true' ]; then logg info 'Extension ID:' echo "$EXT_ID" fi - EXT_SETTINGS_TYPE="$(echo "$EXT" | jq -r '.settings | type')" - EXT_SETTINGS="$(echo "$EXT" | jq -r '.settings')" + EXT_SETTINGS_TYPE="$(echo "$EXT" | jq -nr '.settings | type')" + EXT_SETTINGS="$(echo "$EXT" | jq -nr '.settings')" if [ "$EXT_SETTINGS" != 'null' ]; then logg info 'Evaluating extension settings' if [ "$EXT_SETTINGS_TYPE" == 'array' ]; then - echo "$EXT_SETTINGS" | jq -cr '.[]' | while read EXT_SETTING; do + echo "$EXT_SETTINGS" | jq -cnr '.[]' | while read EXT_SETTING; do logg info 'Applying following extension setting:' echo "$EXT_SETTING" eval "$EXT_SETTING" diff --git a/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl index f3d4d90f..e574f3e2 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_61-plymouth-settings.tmpl @@ -9,6 +9,8 @@ if command -v install-software > /dev/null; then install-software plymouth fi +set -x + ### Apply update-alternatives if command -v update-alternatives > /dev/null; then if [ -f "/usr/local/share/plymouth/themes/{{ .theme }}/{{ .theme }}.plymouth" ]; then diff --git a/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl index 4892082b..a6b9ee02 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_64-grub-settings.tmpl @@ -115,7 +115,7 @@ if [ -f "/boot/grub2/themes/{{ .theme }}-$GRUB_RESOLUTION_TYPE/icons/$GRUB_ICON. else logg warn "/boot/grub2/themes/{{ .theme }}-$GRUB_RESOLUTION_TYPE/icons/$GRUB_ICON.png is missing" fi - +set -x ### Ensure grub2-mkconfig is available if ! command -v grub2-mkconfig > /dev/null; then if command -v grub-mkconfig > /dev/null; then