summaryrefslogblamecommitdiffstats
path: root/.bin/cmus-find-unused
blob: 2fd5f1c0dedce94a0a42c004367136b6a0c5739a (plain) (tree)



















                                              
#!/bin/sh
# Find tracks in no playlist

set -xe

cmus_path="${HOME}/.config/cmus"
music_path="${HOME}/music"
cmus_playlist_files="$(mktemp)"

cat "${cmus_path}/playlists/"* \
	| sort \
	| uniq \
	> "${cmus_playlist_files}"

find "${music_path}" -type f -not -name ".*" \
	| sort \
	| uniq \
	| comm -23 - "${cmus_playlist_files}"

rm "${cmus_playlist_files}"
remember that computers suck.