From aee6bdec48514541c3ffd2764c7f08209f677594 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Tue, 10 Jan 2023 04:25:47 +0000 Subject: [PATCH] Update 2 files - /local/provision.sh - /home/.chezmoiscripts/universal/run_onchange_after_25-gnome-extension-settings.tmpl --- ...nge_after_25-gnome-extension-settings.tmpl | 2 +- local/provision.sh | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 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 4c9db446..793089a7 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 @@ -17,7 +17,7 @@ if [ -f "$HOME/.config/desktop/gnome.yml" ]; then EXT_URL="$(echo "$EXT" | jq -r '.url')" EXT_ID="$(echo "$EXT" | jq -r '.regex')" echo "$EXT_URL" >> /tmp/install-gnome-extensions.txt - find "$HOME/.local/share/gnome-shell/extensions" -mindepth 1 -maxdepth 1 -type d | while read EXT_FOLDER; do + find "$XDG_DATA_DIR/gnome-shell/extensions" -mindepth 1 -maxdepth 1 -type d | while read EXT_FOLDER; do if [[ "$EXT_FOLDER" == "$EXT_REGEX"* ]]; then head -n -1 /tmp/install-gnome-extensions.txt > "$TMP_EXT" mv "$TMP_EXT" /tmp/install-gnome-extensions.txt diff --git a/local/provision.sh b/local/provision.sh index b6d41649..907eefa2 100644 --- a/local/provision.sh +++ b/local/provision.sh @@ -9,12 +9,12 @@ # by calling the appropriate Chezmoi commands. ### Print output to console and log file -if [ ! -d "$HOME/.cache/megabyte-labs" ]; then - mkdir -p "$HOME/.cache/megabyte-labs" +if [ ! -d "${XDG_DATA_DIR:-$HOME/.local/share}/megabyte-labs" ]; then + mkdir -p "${XDG_DATA_DIR:-$HOME/.local/share}/megabyte-labs" fi # Source: https://unix.stackexchange.com/a/323189 exec 3<&1 -coproc logtee { tee "$HOME/.cache/megabyte-labs/betelgeuse.log" >&3; } +coproc logtee { tee "${XDG_DATA_DIR:-$HOME/.local/share}/megabyte-labs/betelgeuse.log" >&3; } exec >&${logtee[1]} 2>&1 # @description Installs glow (a markdown renderer) from GitHub releases @@ -384,13 +384,13 @@ fi ### Copy files to HOME folder with rsync logg info 'Copying files from /usr/local/src/hiawatha to the HOME directory via rsync' -mkdir -p "$HOME/.local/share/chezmoi" -rsync -rtvu --delete /usr/local/src/hiawatha/docs/ "$HOME/.local/share/chezmoi/docs/" & -rsync -rtvu --delete /usr/local/src/hiawatha/home/ "$HOME/.local/share/chezmoi/home/" & -rsync -rtvu --delete /usr/local/src/hiawatha/system/ "$HOME/.local/share/chezmoi/system/" & -rsync -rtvu /usr/local/src/hiawatha/.chezmoiignore "$HOME/.local/share/chezmoi/.chezmoiignore" & -rsync -rtvu /usr/local/src/hiawatha/.chezmoiroot "$HOME/.local/share/chezmoi/.chezmoiroot" & -rsync -rtvu /usr/local/src/hiawatha/software.yml "$HOME/.local/share/chezmoi/software.yml" & +mkdir -p "${XDG_DATA_DIR:-$HOME/.local/share}/chezmoi" +rsync -rtvu --delete /usr/local/src/hiawatha/docs/ "${XDG_DATA_DIR:-$HOME/.local/share}/chezmoi/docs/" & +rsync -rtvu --delete /usr/local/src/hiawatha/home/ "${XDG_DATA_DIR:-$HOME/.local/share}/chezmoi/home/" & +rsync -rtvu --delete /usr/local/src/hiawatha/system/ "${XDG_DATA_DIR:-$HOME/.local/share}/chezmoi/system/" & +rsync -rtvu /usr/local/src/hiawatha/.chezmoiignore "${XDG_DATA_DIR:-$HOME/.local/share}/chezmoi/.chezmoiignore" & +rsync -rtvu /usr/local/src/hiawatha/.chezmoiroot "${XDG_DATA_DIR:-$HOME/.local/share}/chezmoi/.chezmoiroot" & +rsync -rtvu /usr/local/src/hiawatha/software.yml "${XDG_DATA_DIR:-$HOME/.local/share}/chezmoi/software.yml" & logg info 'Waiting for rsync jobs to finish' wait logg success 'Successfully updated the ~/.local/share/chezmoi folder with changes from the upstream repository'