diff --git a/.config/bash/bashrc b/.config/bash/bashrc index fb42b9a..4dc8c12 100644 --- a/.config/bash/bashrc +++ b/.config/bash/bashrc @@ -25,15 +25,26 @@ hist() { } search() { - res=$(find /home/usr/ /home/usr/doc/ \ - -mindepth 1 \ - -not -path '*/.*' \ - -not -path './Mail/*' \ - -not -path './vdir/*' \ - -not -path '*venv*' \ - -not -path '*node_modules*' \ - -not -path '*__pycache__*' \ - -type d | cut -c 11- | fzy) - + if [ "$1" = '-a' ]; then + res=$(find /home/usr/ /home/usr/doc/ \ + -mindepth 1 \ + -not -path '*/.*' \ + -not -path './Mail/*' \ + -not -path './vdir/*' \ + -not -path '*venv*' \ + -not -path '*node_modules*' \ + -not -path '*__pycache__*' \ + -type d | cut -c 11- | fzy) + else + res=$(find $(pwd) \ + -mindepth 1 \ + -not -path '*/.*' \ + -not -path './Mail/*' \ + -not -path './vdir/*' \ + -not -path '*venv*' \ + -not -path '*node_modules*' \ + -not -path '*__pycache__*' \ + -type d | cut -c 11- | fzy) + fi [ -n "$res" ] && cd /home/usr/"$res" }