dotfiles

beau's configuration files
git clone https://git.beauhilton.com/dotfiles.git
Log | Files | Refs | README

music (666B)


      1 #!/bin/sh
      2 
      3 filter() { mpc | head -n 1 | paste -sd ' ';}
      4 
      5 pidof -x mpdupdate >/dev/null 2>&1 || mpdupdate >/dev/null 2>&1 &
      6 
      7 case $BLOCK_BUTTON in
      8     1) mpc status | filter && setsid "$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 - Italic 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     *) mpc status | filter ;;
     18 esac; exit