statuspane 732 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. # Copyright ©2017-2023 Jason Trunks
  3. # https://notabug.org/JasKinasis/cmus-scripts
  4. # An example usage of nowplay
  5. # This is meant to be ran in a pane in something like screen or tmux.
  6. # It runs indefinitely and periodically polls cmus to see what is playing.
  7. # If the track name has changed, the display will update
  8. # Kill it with ctrl+c
  9. # Note: I have added a calendar and date/time along with the track info.
  10. # You could add any other information you want to display, or just leave it
  11. # with just the track information.
  12. prev=""
  13. while true; do
  14. now=$(nowplay);
  15. if [[ "$now" != "$prev" ]]; then
  16. prev=$now
  17. clear;cal;echo;date;echo; echo "$now";#echo "$prev" # extra echo for debug
  18. fi
  19. sleep 5;
  20. done