summaryrefslogtreecommitdiffstats
path: root/.bin/cmus-find-unused
blob: 2fd5f1c0dedce94a0a42c004367136b6a0c5739a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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.