lmariscal

mpris.sh

Apr 8th, 2017
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Specifying the icon(s) in the script
  4. # This allows us to change its appearance conditionally
  5. icon=""
  6.  
  7. player_status=$(playerctl status 2> /dev/null)
  8. if [[ $? -eq 0 ]]; then
  9.     metadata="$(playerctl metadata artist) - $(playerctl metadata title)"
  10. fi
  11.  
  12. # Foreground color formatting tags are optional
  13. if [[ $player_status = "Playing" ]]; then
  14.     echo "%{F#bfaaff77}$icon $metadata"       # Orange when playing
  15. elif [[ $player_status = "Paused" ]]; then
  16.     echo "%{F#65737E}$icon $metadata"       # Greyed out info when paused
  17. else
  18.     echo "%{F#65737E}$icon"                 # Greyed out icon when stopped
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment