From 9b37d8549fa759a3ee402bac3e6a5da9634f459d Mon Sep 17 00:00:00 2001 From: Wiehann Date: Mon, 27 Oct 2025 09:55:38 +0200 Subject: [PATCH] Fix cd command if zoxide is missing (#2609) * Fix cd command if zoxide is missing * Make use of omarchy-cmd-present --- default/bash/aliases | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/default/bash/aliases b/default/bash/aliases index 53254cbb..c87eb8bb 100644 --- a/default/bash/aliases +++ b/default/bash/aliases @@ -4,16 +4,20 @@ alias lsa='ls -a' alias lt='eza --tree --level=2 --long --icons --git' alias lta='lt -a' alias ff="fzf --preview 'bat --style=numbers --color=always {}'" -alias cd="zd" -zd() { - if [ $# -eq 0 ]; then - builtin cd ~ && return - elif [ -d "$1" ]; then - builtin cd "$1" - else - z "$@" && printf "\U000F17A9 " && pwd || echo "Error: Directory not found" - fi -} + +if omarchy-cmd-present z; then + alias cd="zd" + zd() { + if [ $# -eq 0 ]; then + builtin cd ~ && return + elif [ -d "$1" ]; then + builtin cd "$1" + else + z "$@" && printf "\U000F17A9 " && pwd || echo "Error: Directory not found" + fi + } +fi + open() { xdg-open "$@" >/dev/null 2>&1 & }