Files
dotfiles/.conky/music/fetch_meta.sh
2019-11-03 15:04:22 +01:00

22 lines
425 B
Bash
Executable File

#!/bin/bash
old_meta=""
while :
do
if [ "$(playerctl status)" = "Playing" ]
then
new_meta=$(playerctl metadata)
if [ "$new_meta" != "$old_meta" ]
then
echo $new_meta > ~/.conky/music/meta
old_meta=$new_meta
fi
else
new_meta=''
if [ -e ~/.conky/music/meta ]
then
rm ~/.conky/music/meta
fi
fi
sleep 1
done