My dotfiles
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.

20 lines
530 B

  1. #!/bin/sh
  2. artist="$(playerctl metadata artist)"
  3. title="$(playerctl metadata title)"
  4. if [ $# -ge 1 ]; then
  5. if [ "$1" -eq 1 ]; then
  6. playerctl play-pause
  7. else
  8. [ "$1" -eq 2 ] && playerctl next
  9. [ "$1" -eq 3 ] && playerctl previous
  10. artist="$(playerctl metadata artist)"
  11. title="$(playerctl metadata title)"
  12. notify-send -i "media-playback-playing" "Playing now..." "$artist - $title"
  13. fi
  14. else
  15. notify-send -i "media-playback-playing" "Playing now..." "$artist - $title"
  16. fi