From c1b5efa4349bdf7b8b57663b260678dfadac62e8 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 20 Aug 2026 08:10:39 +0200 Subject: zsh: zprofile modularer gestaltet --- zsh/zprofile | 56 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/zsh/zprofile b/zsh/zprofile index 7fed3a7..62604c8 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -11,34 +11,45 @@ add_path() { } set_include_lib_path() { + local prefix="$1" + # Fix für include/lib Verzeichnisse # Details: https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html - export C_INCLUDE_PATH="$1/include:$C_INCLUDE_PATH" - export CPLUS_INCLUDE_PATH="$1/include:$CPLUS_INCLUDE_PATH" - export LIBRARY_PATH="$1/lib:$LIBRARY_PATH" + + export C_INCLUDE_PATH="$prefix/include${C_INCLUDE_PATH:+:$C_INCLUDE_PATH}" + export CPLUS_INCLUDE_PATH="$prefix/include${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" + export LIBRARY_PATH="$prefix/lib${LIBRARY_PATH:+:$LIBRARY_PATH}" } -add_path "$HOME/.cargo/bin" -add_path "$HOME/.local/bin" +set_mac_environment() { + add_path "/opt/homebrew/bin" + set_include_lib_path "/opt/homebrew" +} -case "$OSTYPE" in - darwin*) - add_path "/opt/homebrew/bin" +set_freebsd_environment() { + local texlive_prefix="$HOME/.local/texlive" + + if [[ -d "$texlive_prefix/bin/amd64-freebsd" ]]; then + add_path "$texlive_prefix/bin/amd64-freebsd" + + export MANPATH="${MANPATH:-$(manpath)}:$texlive_prefix/texmf-dist/man" + export INFOPATH="${INFOPATH:+$INFOPATH:}$texlive_prefix/texmf-dist/info" + fi - set_include_lib_path "/opt/homebrew" - ;; - freebsd*) - texlive_prefix="$HOME/.local/texlive" + set_include_lib_path "/usr/local" - if [[ -d "$texlive_prefix/bin/amd64-freebsd" ]]; then - add_path "$texlive_prefix/bin/amd64-freebsd" + # mpd starten + if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then + /usr/local/bin/musicpd + fi +} - export MANPATH="${MANPATH:-$(manpath)}:$texlive_prefix/texmf-dist/man" - export INFOPATH="${INFOPATH:+$INFOPATH:}$texlive_prefix/texmf-dist/info" - fi +add_path "$HOME/.cargo/bin" +add_path "$HOME/.local/bin" - set_include_lib_path "/usr/local" - ;; +case "$OSTYPE" in + darwin*) set_mac_environment ;; + freebsd*) set_freebsd_environment ;; esac # Fix Midnight Commander ESC Taste @@ -56,10 +67,7 @@ export VIT_DIR="$XDG_CONFIG_HOME/vit" # Maildir für mu (mail-utils) export MAILDIR="$HOME/Mail" -# mpd starten -if [[ -x /usr/local/bin/musicpd ]] && ! pgrep "musicpd" > /dev/null; then - /usr/local/bin/musicpd -fi - unfunction add_path unfunction set_include_lib_path +unfunction set_mac_environment +unfunction set_freebsd_environment -- cgit v1.3