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(-) (limited to 'zsh') 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 From b0e1966d43575ce82aeef03560c33df0831ac976 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Tue, 25 Aug 2026 08:09:21 +0200 Subject: zsh: feinere update-funktionen --- zsh/zshrc | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'zsh') diff --git a/zsh/zshrc b/zsh/zshrc index 6f31eaa..ab3730d 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -80,11 +80,40 @@ alias pwgen='pwgen -s 48 1' alias ls='ls -G' # Funktionen +npm-update() { + if (($+commands[npm])); then + npm update -g --loglevel=info + fi +} + nvim-update() { - nvim --headless \ - -c "lua require[[lazy]].sync({ wait = true })" \ - -c "UpdateParsers" \ - -c "qa" + if (($+commands[nvim])); then + nvim --headless \ + -c "lua require[[lazy]].sync({ wait = true })" \ + -c "UpdateParsers" \ + -c "qa" + fi +} + +pkg-update() { + case "$OSTYPE" in + darwin*) + brew update && brew upgrade + ;; + freebsd*) + doas pkg update && doas pkg upgrade + ;; + *) + print -u2 "pkg-update: kein Paketmanager fuer $OSTYPE hinterlegt" + return 1 + ;; + esac +} + +system-update() { + npm-update || return + nvim-update || return + pkg-update } # Command completion -- cgit v1.3 From 8bb17a859b2fc2dbad629a8f6189eb03503f5530 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Tue, 25 Aug 2026 13:07:11 +0200 Subject: zsh: feinere update-funktionen II --- zsh/zshrc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'zsh') diff --git a/zsh/zshrc b/zsh/zshrc index ab3730d..4b15a03 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -104,7 +104,22 @@ pkg-update() { doas pkg update && doas pkg upgrade ;; *) - print -u2 "pkg-update: kein Paketmanager fuer $OSTYPE hinterlegt" + print -u2 "pkg-update: kein Paketmanager für $OSTYPE hinterlegt" + return 1 + ;; + esac +} + +pkg-clean() { + case "$OSTYPE" in + darwin*) + brew autoremove + ;; + freebsd*) + doas pkg autoremove + ;; + *) + print -u2 "pkg-clean: kein Paketmanager für $OSTYPE hinterlegt" return 1 ;; esac @@ -113,7 +128,11 @@ pkg-update() { system-update() { npm-update || return nvim-update || return - pkg-update + pkg-update || return + + if [[ "$1" == "--clean" ]]; then + pkg-clean + fi } # Command completion -- cgit v1.3 From a5fcfee3f33f95b9ad41f42e6676ef0b579904e5 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 27 Aug 2026 13:30:59 +0200 Subject: bootstrap: Weitere Skripte für Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- windows/bin/gmake.cmd | 8 ++------ windows/bin/npm-update.cmd | 3 +++ windows/bin/nvim-update.cmd | 3 --- windows/bin/pkg-update.cmd | 3 +++ windows/bin/system-update.cmd | 10 ++++++++++ zsh/zshrc | 14 +++++--------- 6 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 windows/bin/npm-update.cmd create mode 100644 windows/bin/pkg-update.cmd create mode 100644 windows/bin/system-update.cmd (limited to 'zsh') diff --git a/windows/bin/gmake.cmd b/windows/bin/gmake.cmd index 1c45ce5..5f2bad4 100644 --- a/windows/bin/gmake.cmd +++ b/windows/bin/gmake.cmd @@ -1,11 +1,7 @@ @echo off + rem Wrapper, damit opt.makeprg = "gmake" (aus nvim/lua/config/options.lua) -rem unter Windows funktioniert, ohne die bestehende Config anzupassen. -rem Reicht alle Argumente an das im PATH gefundene "make" weiter. -rem -rem Einmalig einrichten: dieses Verzeichnis (windows\bin) zum PATH -rem hinzufuegen, z.B. ueber: -rem setx PATH "%PATH%;%USERPROFILE%\dotfiles\windows\bin" +rem unter Windows funktioniert. make %* exit /b %ERRORLEVEL% diff --git a/windows/bin/npm-update.cmd b/windows/bin/npm-update.cmd new file mode 100644 index 0000000..9152c97 --- /dev/null +++ b/windows/bin/npm-update.cmd @@ -0,0 +1,3 @@ +@echo off + +npm update -g --loglevel=info diff --git a/windows/bin/nvim-update.cmd b/windows/bin/nvim-update.cmd index 7521e7e..5317f34 100644 --- a/windows/bin/nvim-update.cmd +++ b/windows/bin/nvim-update.cmd @@ -1,8 +1,5 @@ @echo off -rem Prüft vor dem Parser-Update, ob ein C-Compiler (cl.exe, MSVC) im PATH -rem gefunden wird - nvim-treesitter braucht ihn zum Kompilieren der Parser. - where /q cl.exe if errorlevel 1 ( echo [nvim-update] cl.exe nicht gefunden - Neovim aus einer "Developer PowerShell for VS" starten. 1>&2 diff --git a/windows/bin/pkg-update.cmd b/windows/bin/pkg-update.cmd new file mode 100644 index 0000000..3747579 --- /dev/null +++ b/windows/bin/pkg-update.cmd @@ -0,0 +1,3 @@ +@echo off + +winget upgrade --all --accept-package-agreements --accept-source-agreements diff --git a/windows/bin/system-update.cmd b/windows/bin/system-update.cmd new file mode 100644 index 0000000..64a7b9f --- /dev/null +++ b/windows/bin/system-update.cmd @@ -0,0 +1,10 @@ +@echo off + +call npm-update.cmd +if errorlevel 1 exit /b 1 + +call nvim-update.cmd +if errorlevel 1 exit /b 1 + +call pkg-update.cmd +if errorlevel 1 exit /b 1 diff --git a/zsh/zshrc b/zsh/zshrc index 4b15a03..acd9ed5 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -81,18 +81,14 @@ alias ls='ls -G' # Funktionen npm-update() { - if (($+commands[npm])); then - npm update -g --loglevel=info - fi + npm update -g --loglevel=info } nvim-update() { - if (($+commands[nvim])); then - nvim --headless \ - -c "lua require[[lazy]].sync({ wait = true })" \ - -c "UpdateParsers" \ - -c "qa" - fi + nvim --headless \ + -c "lua require[[lazy]].sync({ wait = true })" \ + -c "UpdateParsers" \ + -c "qa" } pkg-update() { -- cgit v1.3 From cd76ca88483048791249846917c7768f7bfe301e Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 2 Sep 2026 07:43:42 +0200 Subject: zsh: Reihenfolge der Update-Funktionen angepasst --- windows/bin/system-update.cmd | 6 +++--- zsh/zshrc | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'zsh') diff --git a/windows/bin/system-update.cmd b/windows/bin/system-update.cmd index 64a7b9f..6c355d0 100644 --- a/windows/bin/system-update.cmd +++ b/windows/bin/system-update.cmd @@ -1,10 +1,10 @@ @echo off -call npm-update.cmd +call pkg-update.cmd if errorlevel 1 exit /b 1 -call nvim-update.cmd +call npm-update.cmd if errorlevel 1 exit /b 1 -call pkg-update.cmd +call nvim-update.cmd if errorlevel 1 exit /b 1 diff --git a/zsh/zshrc b/zsh/zshrc index acd9ed5..41dc612 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -80,17 +80,6 @@ alias pwgen='pwgen -s 48 1' alias ls='ls -G' # Funktionen -npm-update() { - npm update -g --loglevel=info -} - -nvim-update() { - nvim --headless \ - -c "lua require[[lazy]].sync({ wait = true })" \ - -c "UpdateParsers" \ - -c "qa" -} - pkg-update() { case "$OSTYPE" in darwin*) @@ -106,6 +95,17 @@ pkg-update() { esac } +npm-update() { + npm update -g --loglevel=info +} + +nvim-update() { + nvim --headless \ + -c "lua require[[lazy]].sync({ wait = true })" \ + -c "UpdateParsers" \ + -c "qa" +} + pkg-clean() { case "$OSTYPE" in darwin*) @@ -122,9 +122,9 @@ pkg-clean() { } system-update() { + pkg-update || return npm-update || return nvim-update || return - pkg-update || return if [[ "$1" == "--clean" ]]; then pkg-clean -- cgit v1.3