diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-02-10 15:10:33 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-02-10 15:10:33 +0900 |
| commit | 8415c0e4aa1d7e10df045cf9408916842efaa9b6 (patch) | |
| tree | 5839b375dadff8eb4863bf80e6d8d26ee32dd9be /ar/.local/bin/dmenusmbadd | |
| parent | 5c0c15506b8f86a424a7a7006b2376b1d9fd7486 (diff) | |
modified lf/scope, modified bin/dmenusmbadd, modified bin/rgafiles, modified bin/ylog
Diffstat (limited to 'ar/.local/bin/dmenusmbadd')
| -rwxr-xr-x | ar/.local/bin/dmenusmbadd | 12 |
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 |
