From c8d02955dc0895661e226b52a9f274059fa5a450 Mon Sep 17 00:00:00 2001 From: dabruh <11458706-dabruh@users.noreply.gitlab.com> Date: Thu, 11 Apr 2024 12:15:19 +0200 Subject: [PATCH] Move homebrew dir --- .config/shell/profile | 7 +++++-- .config/zsh/.zshrc | 6 +++--- setup_system.sh | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.config/shell/profile b/.config/shell/profile index 1c7f1bb..8273596 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -102,8 +102,11 @@ prepend_paths=( ) append_paths=() -[ -f "$HOME/homebrew/bin/brew" ] && eval "$("$HOME/homebrew/bin/brew" shellenv)" -[ -n "$HOMEBREW_PREFIX" ] && append_paths+=("$HOMEBREW_PREFIX/bin" "$HOMEBREW_PREFIX/sbin") +HOMEBREW_PREFIX="$XDG_DATA_HOME/homebrew" +if [ -x "$HOMEBREW_PREFIX/bin/brew" ]; then + eval "$("$HOMEBREW_PREFIX/bin/brew" shellenv)" + append_paths+=("$HOMEBREW_PREFIX/bin" "$HOMEBREW_PREFIX/sbin") +fi rm_path_entries "${prepend_paths[@]}" "${append_paths[@]}" # Ensure we clean up first prepend_path_with_entries "${prepend_paths[@]}" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 74c8106..cf69550 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -128,13 +128,13 @@ git_prompt_string() { ## Plugins section: Enable fish style features # Use syntax highlighting -source $HOME/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source $HOME/.local/share/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # Use history substring search -source $HOME/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh +source $HOME/.local/share/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh # Use autosuggestion -source $HOME/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh +source $HOME/.local/share/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' diff --git a/setup_system.sh b/setup_system.sh index e17b41e..fb79cd0 100755 --- a/setup_system.sh +++ b/setup_system.sh @@ -162,7 +162,7 @@ function install_picom() { } function setup_homebrew() { - local dir="$HOME/homebrew" + local dir="${XDG_DATA_HOME:?}/homebrew" echo "Setting up Homebrew."