aboutsummaryrefslogtreecommitdiffstats
path: root/.zshrc-linux-desktop
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2016-02-01 22:45:25 -0700
committerkatherine <shmibs@shmibbles.me>2016-02-01 22:45:25 -0700
commit48f48240e3d980785b146584dd81a390d3e1af47 (patch)
treeaaac4ffb99210a121e6390527689be18afa55baf /.zshrc-linux-desktop
parentb7bf00c5dc033406fd00d95e6a9dd8e663be3a4e (diff)
downloaddotfiles-48f48240e3d980785b146584dd81a390d3e1af47.tar.gz
mpd-cover-convert
Diffstat (limited to '.zshrc-linux-desktop')
-rw-r--r--.zshrc-linux-desktop13
1 files changed, 12 insertions, 1 deletions
diff --git a/.zshrc-linux-desktop b/.zshrc-linux-desktop
index f92845b..e744785 100644
--- a/.zshrc-linux-desktop
+++ b/.zshrc-linux-desktop
@@ -15,6 +15,16 @@ mpd-sleep() {
done
}
+mpd-cover-convert() {
+ find ~/music -type f -regextype posix-extended -regex ".*cover\.(png|jpg)"\
+ | while read file; do
+ d=$(dirname "$file")
+ if [[ ! -f "$d/cover-small.png" ]]; then
+ convert "$file" -resize 250x "$d/cover-small.png"
+ fi
+ done
+}
+
# list stats about mpd library file types, to motivate me
# to do better!
mpd-filetypes() {
@@ -23,7 +33,8 @@ mpd-filetypes() {
# hackily yoink recognised types from mpd --version
types=(); mpd --version \
| sed -n '1h; 1!H; ${g; s/.*Decoders plugins:\(.*\)Output.*/\1/g; p}'\
- | tr -s ' ' '\n' | sed -e 's/.*\]//' -e '/^$/d' | sort | uniq | while read word; do
+ | tr -s ' ' '\n' | sed -e 's/.*\]//' -e '/^$/d' | sort | uniq\
+ | while read word; do
types[$(( ${#types} + 1 ))]="$word"
done
types[$(( ${#types} + 1 ))]="other"