2018-06-02 00:14:44 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
pkill -SIGRTMIN+13 i3blocks
|
|
|
|
|
|
2018-11-30 22:00:19 +01:00
|
|
|
|
pidof cava && pkill -USR1 cava
|
|
|
|
|
|
2018-06-02 00:14:44 +02:00
|
|
|
|
[[ $# -eq 0 ]] && exit
|
|
|
|
|
|
|
|
|
|
file="$1"
|
|
|
|
|
duration="$2"
|
|
|
|
|
title="$3"
|
|
|
|
|
artist="$4"
|
|
|
|
|
album="$5"
|
|
|
|
|
|
|
|
|
|
## Debug
|
|
|
|
|
#notify-send "MOC" \
|
|
|
|
|
#"Fichier : $file
|
|
|
|
|
#Durée : $duration
|
|
|
|
|
#Titre : $title
|
|
|
|
|
#Artiste : $artist
|
|
|
|
|
#Album : $album"
|
|
|
|
|
|
|
|
|
|
if [[ -z "$title" ]]
|
|
|
|
|
then
|
|
|
|
|
notify-send "Music On Console" "$(basename "$file" | rev | cut -d'.' -f2- | rev)"
|
2019-01-10 23:28:52 +01:00
|
|
|
|
echo "$(basename "$file" | rev | cut -d'.' -f2- | rev)" > /dev/shm/mocp
|
2018-06-02 00:14:44 +02:00
|
|
|
|
else
|
|
|
|
|
string="$title"
|
|
|
|
|
[[ -n "$artist" ]] && string="$artist - $string"
|
|
|
|
|
[[ -n "$album" ]] && string="$string\n$album"
|
|
|
|
|
notify-send "Music On Console" "$string"
|
2019-01-10 23:28:52 +01:00
|
|
|
|
echo "$title" > /dev/shm/mocp
|
2018-06-02 00:14:44 +02:00
|
|
|
|
fi
|