aboutsummaryrefslogtreecommitdiffstats
path: root/.config/init/funcs/mpd-cover-convert
diff options
context:
space:
mode:
Diffstat (limited to '.config/init/funcs/mpd-cover-convert')
-rwxr-xr-x.config/init/funcs/mpd-cover-convert12
1 files changed, 12 insertions, 0 deletions
diff --git a/.config/init/funcs/mpd-cover-convert b/.config/init/funcs/mpd-cover-convert
new file mode 100755
index 0000000..cd3569a
--- /dev/null
+++ b/.config/init/funcs/mpd-cover-convert
@@ -0,0 +1,12 @@
+#!/bin/zsh
+# make small cover versions for mpc-notify.sh
+# leaks memory for some reason, so don't run on a clean library
+# or it'll crash everything
+
+local d
+find ~/music -type f -regextype posix-extended -regex ".*cover\.(png|jpg)"\
+ | while read file; do
+ if [[ ! -f "${file:h}/cover-small.png" ]]; then
+ convert "$file" -resize 250x "${file:h}/cover-small.png"
+ fi
+done