diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2024-05-14 18:53:03 +0200 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2024-05-14 18:53:03 +0200 |
commit | 612dbb6993c8a548744f29a4d15d6b31325357c8 (patch) | |
tree | 0d61cee0ea74ac811268d0ffc00d3d55f7174112 /.bin/cmus-find-unused | |
parent | 23e2bfd987c430bb41bc7860c46c2f572e9e2db4 (diff) | |
download | dots-612dbb6993c8a548744f29a4d15d6b31325357c8.tar.gz |
Diffstat (limited to '.bin/cmus-find-unused')
-rwxr-xr-x | .bin/cmus-find-unused | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.bin/cmus-find-unused b/.bin/cmus-find-unused new file mode 100755 index 0000000..2fd5f1c --- /dev/null +++ b/.bin/cmus-find-unused @@ -0,0 +1,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}" |