29 lines
530 B
Bash
Executable file
29 lines
530 B
Bash
Executable file
#!/bin/bash
|
||
|
||
pkill -SIGRTMIN+13 i3blocks
|
||
|
||
[[ $# -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)"
|
||
else
|
||
string="$title"
|
||
[[ -n "$artist" ]] && string="$artist - $string"
|
||
[[ -n "$album" ]] && string="$string\n$album"
|
||
notify-send "Music On Console" "$string"
|
||
fi
|