2021-02-05 21:48:22 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# @author : swytch (swytch@$HOSTNAME)
|
|
|
|
# @file : player
|
2021-02-15 00:37:34 +01:00
|
|
|
# @license : GPLv3
|
2021-02-05 21:48:22 +01:00
|
|
|
# @created : Friday Feb 05, 2021 21:42:00 CET
|
|
|
|
#
|
2021-02-14 19:07:45 +01:00
|
|
|
# @description : simple wrapper for mpc, to send notifications
|
2021-02-05 21:48:22 +01:00
|
|
|
######################################################################
|
|
|
|
|
|
|
|
|
2021-02-16 23:54:37 +01:00
|
|
|
MPC_FORMAT="Artist: <b>%artist%</b> \nTitle: %title% \nAlbum: %album%"
|
|
|
|
out="$(mpc --format "$MPC_FORMAT" $1 | head -n-1)"
|
2021-03-02 20:28:37 +01:00
|
|
|
kill -39 $(pidof dwmblocks)
|
2021-02-16 23:54:37 +01:00
|
|
|
if [ -z "$out" ]; then
|
2021-03-02 20:28:37 +01:00
|
|
|
exit
|
2021-02-12 00:11:27 +01:00
|
|
|
else
|
2021-03-02 20:28:37 +01:00
|
|
|
path="$(mpc --format %file% | head -n1 | awk -F '/' '{ printf "music/%s/%s/cover.jpg\n", $1,$2 }')"
|
|
|
|
dunstify -r 10010 -u "normal" -i "$HOME/$path" "MPD" "$out"
|
2021-02-12 00:11:27 +01:00
|
|
|
fi
|
2021-02-13 20:17:30 +01:00
|
|
|
|