add support for fd-find for faster searching

This commit is contained in:
xesc 2024-07-26 23:11:06 +02:00
parent a34cbeca73
commit e02e6c2620

View file

@ -1,7 +1,12 @@
#!/usr/bin/bash
HOMEDIR=~
SEL_DIR=$(find ~ -not -path "*/.*" -type d -print 2>/dev/null | fzf)
which fd > /dev/null
if [ 0 = $? ]; then
SEL_DIR=$(fd --type directory | fzf) # if fd-find is installed
else
SEL_DIR=$(find ~ -not -path "*/.*" -type d -print 2>/dev/null | fzf)
fi
SEL_NAME=$(basename "$SEL_DIR")
new_session_name(){