summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Minnocci2021-01-28 17:04:10 +0100
committerFrancesco Minnocci2021-01-28 17:04:10 +0100
commit0827741c7004e47fedd7442ce10ca113f855148b (patch)
treed01195c463e3273bd503ceb21948a7205d819e9b
parent06e0518f48ce06187d1b69776b93466e2cf78254 (diff)
downloadaur-0827741c7004e47fedd7442ce10ca113f855148b.tar.gz
upstream PRs: add fix for cover names, clean exit if sxiv is closed and other minor changes; fix typo in package description
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD7
-rw-r--r--exiftool.patch67
3 files changed, 58 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ec157acf198c..21cbbff9b8b3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = kunst-git
- pkgdesc = kunst is a deamon that extracts the album art from the songs playing in mpd.
+ pkgdesc = kunst is a daemon that extracts the album art from the songs playing in mpd.
pkgver = 20200821
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/sdushantha/kunst
arch = any
license = MIT
@@ -18,6 +18,6 @@ pkgbase = kunst-git
source = git+https://github.com/sdushantha/kunst.git
source = exiftool.patch
sha256sums = SKIP
- sha256sums = e157b0b3a1f48dc2805ba89b073315b3f9f095de6fdfeecfa00837f4aa8f7954
+ sha256sums = 30f85127add3a33aa491474c949c978e9d827e13096091733a047432212adc3d
pkgname = kunst-git
diff --git a/PKGBUILD b/PKGBUILD
index 0d8103b51f4b..bb55273649e9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,10 +1,11 @@
# Maintainer: Francesco Minnocci <ascoli dot minnocci at gmail dot com>
# Contributor: Martin Friedrich <npanic@acid.wtf>
+
pkgname=kunst-git
_pkgname=kunst
pkgver=20200821
-pkgrel=2
-pkgdesc="kunst is a deamon that extracts the album art from the songs playing in mpd."
+pkgrel=3
+pkgdesc="kunst is a daemon that extracts the album art from the songs playing in mpd."
arch=('any')
url="https://github.com/sdushantha/kunst"
license=('MIT')
@@ -18,7 +19,7 @@ source=(
)
sha256sums=(
'SKIP'
- 'e157b0b3a1f48dc2805ba89b073315b3f9f095de6fdfeecfa00837f4aa8f7954'
+ '30f85127add3a33aa491474c949c978e9d827e13096091733a047432212adc3d'
)
pkgver() {
diff --git a/exiftool.patch b/exiftool.patch
index 6e56fc5bf7eb..b0c6a7d28d96 100644
--- a/exiftool.patch
+++ b/exiftool.patch
@@ -1,15 +1,6 @@
---- kunst/kunst 2021-01-28 16:13:36.308318729 +0100
-+++ kunst/kunst 2021-01-28 16:17:06.101650374 +0100
-@@ -8,7 +8,7 @@
-
-
- VERSION=1.3.2
--COVER=/tmp/kunst.jpg
-+COVER=/tmp/kunst.png
- MUSIC_DIR=~/Music/
- SIZE=250x250
- POSITION="+0+0"
-@@ -138,17 +138,32 @@
+--- kunst/kunst 2021-01-28 16:47:58.699911730 +0100
++++ kunst/kunst 2021-01-28 16:59:59.266594769 +0100
+@@ -138,33 +138,55 @@
# Extract the album art from the mp3 file and dont show the messsy
# output of ffmpeg
@@ -43,11 +34,36 @@
ARTLESS=false
else
- DIR="$MUSIC_DIR$(dirname "$(mpc current -f %file%)")"
-+ DIR="$MUSIC_DIR/$(dirname "$(mpc current -f %file%)")"
- [ ! "$SILENT" ] && echo "kunst: inspecting $DIR"
+- [ ! "$SILENT" ] && echo "kunst: inspecting $DIR"
++ DIR="$MUSIC_DIR/$(dirname "$(mpc current -f %file%)")"
++
++ # prevent iterating the entire $MUSIC_DIR if mpc experiences an error
++ [ "$DIR" == "$MUSIC_DIR". ] && return 1
++
++ [ ! "$SILENT" ] && echo "kunst: inspecting $DIR"
++
++ COVER_NAMES=${KUNST_COVER_NAMES:-'folder|cover|front'}
++ COVER_EXT=${KUNST_COVER_EXT:-'jpg|png'}
# Check if there is an album cover/art in the folder.
-@@ -164,7 +179,7 @@
+- # Look at issue #9 for more details
+- for CANDIDATE in "$DIR/cover."{png,jpg}; do
+- if [ -f "$CANDIDATE" ]; then
+- STATUS=0
+- ARTLESS=false
+- convert "$CANDIDATE" $COVER &> /dev/null
+- [ ! "$SILENT" ] && echo "kunst: found cover.png"
+- fi
+- done
++ # Look at issues #9 and #45 for more details
++ while IFS= read -r CANDIDATE; do
++ if [ -f "$CANDIDATE" ]; then
++ STATUS=0
++ ARTLESS=false
++ convert "$CANDIDATE" $COVER &> /dev/null
++ [ ! "$SILENT" ] && echo "kunst: found $(basename "$CANDIDATE")"
++ fi
++ done < <(find "$DIR" -type f | grep -i -E -- "($COVER_NAMES).($COVER_EXT)")
fi
if [ "$STATUS" -ne 0 ];then
@@ -56,7 +72,7 @@
get_cover_online
fi
}
-@@ -211,9 +226,6 @@
+@@ -211,9 +233,6 @@
update_cover
if [ "$ARTLESS" == true ];then
@@ -66,3 +82,22 @@
# Decode the base64 encoded image and save it
# to /tmp/kunst.png
+@@ -229,8 +248,9 @@
+ FIRST_RUN=false
+
+ # Display the album art using sxiv
+- sxiv -g "$SIZE$POSITION" -b "$COVER" -N "Kunst" &
+-
++ # If sxiv is closed, kill the script as well with the trap at the end of
++ # the script (see issue #48).
++ (sxiv -g "$SIZE$POSITION" -b "$COVER" -N "Kunst"; kill -USR1 0) &
+ # Save the process ID so that we can kill
+ # sxiv when the user exits the script
+ echo $! >/tmp/kunst.pid
+@@ -251,4 +271,6 @@
+ trap "" SIGTSTP
+
+ trap pre_exit EXIT
++trap 'exit 1' TERM HUP INT
++trap 'exit 0' USR1
+ main