ftp -o - https://jcs.org/move_in | sh -
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

bin/music: add wrapper script for controlling music-playing things

+96
+96
bin/music
··· 1 + #!/bin/sh 2 + 3 + CMUS="cmus" 4 + PIANOBAR="pianobar" 5 + AUDACIOUS="audacious" 6 + 7 + PLAYER="" 8 + if [ ! X`pgrep cmus` = X"" ]; then 9 + PLAYER=$CMUS 10 + elif [ ! X`pgrep pianobar` = X"" ]; then 11 + PLAYER=$PIANOBAR 12 + elif [ ! X`pgrep audacious` = X"" ]; then 13 + PLAYER=$AUDACIOUS 14 + else 15 + echo "no music player" 16 + exit 1 17 + fi 18 + 19 + case "$1" in 20 + next) 21 + case $PLAYER in 22 + $CMUS) 23 + ;; 24 + $PIANOBAR) 25 + echo -n 'n' > ~/.config/pianobar/ctl 26 + ;; 27 + $AUDACIOUS) 28 + audtool playlist-advance 29 + ;; 30 + esac 31 + ;; 32 + nextalbum) 33 + case $PLAYER in 34 + $CMUS) 35 + ;; 36 + $PIANOBAR) 37 + ;; 38 + $AUDACIOUS) 39 + audtool playlist-advance-album 40 + ;; 41 + esac 42 + ;; 43 + prev) 44 + case $PLAYER in 45 + $CMUS) 46 + ;; 47 + $PIANOBAR) 48 + # not possible 49 + ;; 50 + $AUDACIOUS) 51 + audtool playlist-reverse 52 + ;; 53 + esac 54 + ;; 55 + prevalbum) 56 + case $PLAYER in 57 + $CMUS) 58 + ;; 59 + $PIANOBAR) 60 + ;; 61 + $AUDACIOUS) 62 + audtool playlist-reverse-album 63 + ;; 64 + esac 65 + ;; 66 + pause) 67 + case $PLAYER in 68 + $CMUS) 69 + cmus-remote -u 70 + ;; 71 + $PIANOBAR) 72 + echo -n 'S' > ~/.config/pianobar/ctl 73 + ;; 74 + $AUDACIOUS) 75 + audtool playback-pause 76 + ;; 77 + esac 78 + ;; 79 + playpause) 80 + case $PLAYER in 81 + $CMUS) 82 + cmus-remote -u 83 + ;; 84 + $PIANOBAR) 85 + echo -n 'p' > ~/.config/pianobar/ctl 86 + ;; 87 + $AUDACIOUS) 88 + audtool playback-playpause 89 + ;; 90 + esac 91 + ;; 92 + *) 93 + echo "unknown command \"${1}\"" 94 + exit 1 95 + ;; 96 + esac