From afd61edd60f7dbbac8fbeaa3fb71e045c61ea1f9 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 2 Jun 2025 17:11:45 +0200 Subject: [PATCH] addet ssh different oh-my-posh theme --- .zshrc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 00089d8..1e27005 100644 --- a/.zshrc +++ b/.zshrc @@ -108,8 +108,21 @@ __shell_qol__() { fi if command_exists zoxide; then - eval "$(zoxide init zsh)" - eval "$(zoxide init zsh --cmd cd)" + + local raw="$(zoxide --version | awk '{print $2}')" + local ver="${raw#v}" # remove leading 'v' + local ver="${ver%%-*}" # remove anything after dash + + # local ver="$(zoxide --version | cut -d' ' -f2)" + if [[ "$ver" =~ ^0\.([0-5]|[0-9]{1,2})\. ]]; then + # older than 0.5.x + eval "$(zoxide init zsh)" + else + # newer than 0.5.x + eval "$(zoxide init zsh)" + eval "$(zoxide init zsh --cmd cd)" + fi + # ─< easier dir up >──────────────────────────────────────────────────────────────────────── alias ..="z .." else