Browse Source

tmux: limit length of music info

master
Schneider 4 years ago
parent
commit
1a2b6cda9f
Signed by: schneider GPG Key ID: 3F50B02A50039F3B
  1. 5
      tmux/clementine.sh

5
tmux/clementine.sh

@ -1,5 +1,8 @@
#!/usr/bin/env zsh
set -eu
if hash clementine 2>/dev/null && pgrep clementine > /dev/null; then if hash clementine 2>/dev/null && pgrep clementine > /dev/null; then
ARTIST=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:artist: ' | cut -c15-) ARTIST=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:artist: ' | cut -c15-)
TITLE=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:title: ' | cut -c14-) TITLE=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:title: ' | cut -c14-)
echo "$ARTIST - $TITLE"
COMBINED="$ARTIST - $TITLE"
echo ${COMBINED:0:40}
fi fi
Loading…
Cancel
Save