Advertisement
addy-dclxvi

popup

Feb 4th, 2018
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. #! /bin/bash
  2.     MUSIC_DIR=/media/addy/Media/musik/
  3.     COVER=/tmp/cover.png
  4.     back="/home/addy/cover.png"
  5.    
  6. {   album="$(mpc --format %album% current)"
  7.     file="$(mpc --format %file% current)"
  8.     album_dir="${file%/*}"
  9.     [[ -z "$album_dir" ]] && exit 1
  10.     album_dir="$MUSIC_DIR/$album_dir"
  11.  
  12.     covers="$(find "$album_dir" -type d -exec find {} -maxdepth 1 -type f -iregex ".*/.*\(${album}\|cover\|folder\|artwork\|front\).*[.]\(jpe?g\|png\|gif\|bmp\)" \; )"
  13.    src="$(echo -n "$covers" | head -n1)"
  14.    rm -f "$COVER"
  15.    convert "$src" -resize 150 "$COVER"
  16.    n30f -b -x 1095 -y 40 -d ${back}
  17.    n30f -b -x 1120 -y 65 -d ${COVER}
  18. } &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement