hyprdots

my dotfiles
git clone https://git.awy.one/hyprdots.git
Log | Files | Refs | README | LICENSE

sb-music (765B)


      1 #!/bin/sh
      2 
      3 filter() { sed "/^volume:/d;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;}
      4 
      5 pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
      6 
      7 case $1 in
      8   1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;;  # right click, pause/unpause
      9   2) mpc toggle | filter ;;  # right click, pause/unpause
     10   3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing.
     11   - ⏸ when paused.
     12   - Left click opens ncmpcpp.
     13   - Middle click pauses.
     14   - Scroll changes track.";;  # right click, pause/unpause
     15   4) mpc prev   | filter ;;  # scroll up, previous
     16   5) mpc next   | filter ;;  # scroll down, next
     17   8) mpc status | filter ; setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
     18   *) mpc status | filter ;;
     19 esac