All of my important config files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
557 B

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