2017-11-22 01:27:01 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
case $BLOCK_BUTTON in
|
|
|
|
1) mocp -r ;;
|
|
|
|
2) mocp -G ;;
|
|
|
|
3) mocp -f ;;
|
|
|
|
4) mocp -j $(($(mocp -Q "%cs") - 5))s ;;
|
|
|
|
5) mocp -j $(($(mocp -Q "%cs") + 5))s ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
status=$(mocp -Q "%state")
|
|
|
|
case $status in
|
|
|
|
STOP ) status="[]" ;;
|
|
|
|
PAUSE ) status="||" ;;
|
|
|
|
PLAY ) status=" >" ;;
|
|
|
|
esac
|
|
|
|
|
2018-03-06 14:47:28 +01:00
|
|
|
dots=
|
|
|
|
song=$(mocp -Q "%song")
|
|
|
|
|
|
|
|
[[ -z "$song" ]] && song=$(basename "$(mocp -Q %file)")
|
|
|
|
|
|
|
|
if [ ${#song} -gt 30 ]
|
|
|
|
then
|
|
|
|
dots="…"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $status ${song:0:30}$dots
|