diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-25 20:51:27 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-25 20:51:27 +0900 |
| commit | 6bd7c20f25dbee51d61ef22b21e3831d64e82a05 (patch) | |
| tree | f2fff1f0c8795126bca05bb66c0f12ead4e47fcd /ar/.local/bin/dmenudelmusic | |
| parent | f2ed278aee005b0a3f0a33233c55f0026cfd2aad (diff) | |
modified playlists/entire.m3u, modified bin/dmenudelmusic, modified bin/qndl, modified Music/.music.txt
Diffstat (limited to 'ar/.local/bin/dmenudelmusic')
| -rwxr-xr-x | ar/.local/bin/dmenudelmusic | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ar/.local/bin/dmenudelmusic b/ar/.local/bin/dmenudelmusic index 91beeac..91994fb 100755 --- a/ar/.local/bin/dmenudelmusic +++ b/ar/.local/bin/dmenudelmusic @@ -4,8 +4,11 @@ music_dir="${XDG_MUSIC_DIR:-${HOME}/Music}" music_txt="${music_dir}/.music.txt" playlist_dir="${XDG_CONFIG_HOME:-${HOME}/.config}/mpd/playlists" -# Select the relative path (so we can find the actual file in subdirectories) -selected_relpath=$(cd "$music_dir" && find . -type f | sed 's|^\./||' | dmenu -i -l 20 -p "Select a file to delete:") || exit 1 +# Select the relative path. Sort the list so "first match" semantics in dmenu +# are deterministic — otherwise filesystem order is unstable and typing a +# substring (e.g. "성시경") can return whichever file find walked first. +# `-not -path '*/.*'` skips hidden files (.music.txt, etc.); name filter limits to audio. +selected_relpath=$(cd "$music_dir" && find . -type f -not -path '*/.*' \( -name '*.mp3' -o -name '*.m4a' -o -name '*.opus' -o -name '*.flac' -o -name '*.wav' -o -name '*.webm' \) | sed 's|^\./||' | LC_ALL=C.UTF-8 sort | dmenu -i -l 20 -p "Select a file to delete:") || exit 1 [ -n "$selected_relpath" ] || exit 1 selected_file="$music_dir/$selected_relpath" |
