From 187940e002302dfcaa83b01fc0b63a84a74f6792 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 21 Sep 2021 15:51:23 +0200 Subject: Lain should not be here --- lain/scripts/mpdcover | 68 --------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100755 lain/scripts/mpdcover (limited to 'lain/scripts/mpdcover') diff --git a/lain/scripts/mpdcover b/lain/scripts/mpdcover deleted file mode 100755 index 6f9062c..0000000 --- a/lain/scripts/mpdcover +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -# A simple cover fetcher script for current playing song on mpd. -# -# Original author: Wolfgang Mueller -# -# Adapted for Lain internal use. -# https://github.com/copycat-killer/lain -# -# You can use, edit and redistribute this script in any way you like. -# -# Dependencies: imagemagick. -# -# Usage: mpdcover - -# Configuration------------------------------------------------------- - -# Music directory -MUSIC_DIR=$1 - -# Song file -file=$2 - -# Regex expression used for image search -IMG_REG="(Front|front|Cover|cover|Art|art|Folder|folder)\.(jpg|jpeg|png|gif)$" - -# Path of temporary resized cover -TEMP_PATH="/tmp/mpdcover.png" - -# Resize cover -COVER_RESIZE="$3x$3" - -if [ $COVER_RESIZE == "x" ]; then - COVER_RESIZE="100x100" -fi - -# The default cover to use (optional) -DEFAULT_ART=$4 - -# Thumbnail background (transparent) -COVER_BACKGROUND="none" - -#-------------------------------------------------------------------- - -# check if anything is playing at all -[[ -z $file ]] && exit 1 - -# Art directory -art="$MUSIC_DIR/${file%/*}" - -# find every file that matches IMG_REG set the first matching file to be the -# cover. -cover="$(find "$art/" -maxdepth 1 -type f | egrep -i -m1 "$IMG_REG")" - -# when no cover is found, use DEFAULT_ART as cover -cover="${cover:=$DEFAULT_ART}" - -# check if art is available -if [[ -n $cover ]]; then - if [[ -n $COVER_RESIZE ]]; then - convert "$cover" -scale $COVER_RESIZE -gravity "center" -background "$COVER_BACKGROUND" "$TEMP_PATH" - cover="$TEMP_PATH" - fi -else - rm $TEMP_PATH -fi - -exit 0 -- cgit v1.2.3-54-g00ecf