summaryrefslogtreecommitdiff
path: root/ar/.local/bin/dmenusmbadd
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-02-10 15:10:33 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-02-10 15:10:33 +0900
commit9d1f41397de1f58f158f9af0b73ed9d30e5027a5 (patch)
tree09feedd5c811de5e30654f028d1d381e6c77f589 /ar/.local/bin/dmenusmbadd
parent7cddd694437fce9e61849d3a98349cf0fe1faffb (diff)
modified lf/scope, modified bin/dmenusmbadd, modified bin/rgafiles, modified bin/ylogHEADmaster
Diffstat (limited to 'ar/.local/bin/dmenusmbadd')
-rwxr-xr-xar/.local/bin/dmenusmbadd12
1 files changed, 9 insertions, 3 deletions
diff --git a/ar/.local/bin/dmenusmbadd b/ar/.local/bin/dmenusmbadd
index d1b76cd..b4b720b 100755
--- a/ar/.local/bin/dmenusmbadd
+++ b/ar/.local/bin/dmenusmbadd
@@ -32,9 +32,15 @@ else
target_name="$folder_name"
fi
- folder_path=$(for path in $base_path; do
- find "$path" -type d -iname "$target_name" -print 2>/dev/null
- done | sort -r | dmenu -l 10 -p "Select the folder to share:")
+ if command -v fd >/dev/null 2>&1; then
+ # Use fd if available (fastest)
+ folder_path=$(for path in $base_path; do
+ fd -t d -d 3 -i "^$target_name$" "$path" 2>/dev/null
+ done | sed 's:/$::' | sort -r | dmenu -l 10 -p "Select the folder to share:")
+ else
+ # Fallback to parallel find with depth limit
+ folder_path=$(printf "%s\n" $base_path | xargs -P 3 -I {} find {} -maxdepth 3 -type d -iname "$target_name" -print 2>/dev/null | sed 's:/$::' | sort -r | dmenu -l 10 -p "Select the folder to share:")
+ fi
[ -z "$folder_path" ] && notify-send "📁Folder not found." && exit 1
fi