Add configuration files
This commit is contained in:
parent
73b1ebe491
commit
0f125a7d4f
12 changed files with 658 additions and 0 deletions
36
files/cmus/notify.sh
Executable file
36
files/cmus/notify.sh
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
#CMUS notification
|
||||
#
|
||||
options="--app-name=cmus"
|
||||
body=""
|
||||
while [ "$#" -ge 2 ]
|
||||
do
|
||||
eval $1='$2'
|
||||
shift
|
||||
shift
|
||||
done
|
||||
|
||||
filename=${file##*/}
|
||||
image=${file%/*}/cover.jpg
|
||||
[ -f "$image" ] && options="$options -i ${image}"
|
||||
|
||||
title=${title:-$filename}
|
||||
|
||||
if [ -n "$artist" ]
|
||||
then
|
||||
body="$body <i>$artist</i>\n"
|
||||
fi
|
||||
|
||||
if [ -n "$album" ]
|
||||
then
|
||||
body="$body $album"
|
||||
fi
|
||||
|
||||
if [ -n "$date" ]
|
||||
then
|
||||
body="$body ${date%%-*}"
|
||||
fi
|
||||
body=${body:-'no informations'}
|
||||
|
||||
notify-send $options "$title" "$body"
|
Loading…
Add table
Add a link
Reference in a new issue