Fix music display
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
5ab6dbae69
commit
d8eb460ab1
2 changed files with 9 additions and 10 deletions
|
@ -23,7 +23,7 @@ setxkbmap -model pc105 -layout ch
|
|||
redshift &
|
||||
|
||||
# Merge .Xresources on boot
|
||||
xrdb -merge $HOME/.Xresources
|
||||
xrdb -merge "$HOME/.Xresources"
|
||||
|
||||
# Start ibus
|
||||
#ibus-daemon -drx
|
||||
|
|
|
@ -21,7 +21,9 @@ TITLE="$(echo "$QUERY" | grep -e " title " | cut -d " " -f 3-)"
|
|||
position="$(echo "$QUERY" | grep -e "position " | cut -d " " -f 2)"
|
||||
duration="$(echo "$QUERY" | grep -e "duration " | cut -d " " -f 2)"
|
||||
|
||||
|
||||
if [ "$STATUS" != "playing" ]; then
|
||||
OUTPUT="Not playing"
|
||||
else
|
||||
pos_minutes=$(printf "%02d" $(("$position" / 60)))
|
||||
pos_seconds=$(printf "%02d" $(("$position" % 60)))
|
||||
|
||||
|
@ -29,9 +31,6 @@ dur_minutes=$(printf "%02d" $(("$duration" / 60)))
|
|||
dur_seconds=$(printf "%02d" $(("$duration" % 60)))
|
||||
|
||||
OUTPUT="$ARTIST | $ALBUM | $TITLE | $pos_minutes:$pos_seconds / $dur_minutes:$dur_seconds"
|
||||
|
||||
if [ "$STATUS" != "playing" ]; then
|
||||
OUTPUT="Not playing"
|
||||
fi
|
||||
|
||||
echo "$OUTPUT"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue