2018-12-01 19:34:14 +00:00
|
|
|
#!/bin/sh
|
2018-05-07 16:07:47 +00:00
|
|
|
|
2018-07-30 00:52:57 +00:00
|
|
|
# A general audio interface for LARBS.
|
|
|
|
|
2018-05-07 16:07:47 +00:00
|
|
|
newvol="pkill -RTMIN+10 i3blocks"
|
2018-10-07 12:33:38 +00:00
|
|
|
|
|
|
|
[ -z "$2" ] && num="2" || num="$2"
|
2018-05-07 16:07:47 +00:00
|
|
|
|
|
|
|
case "$1" in
|
2018-10-07 12:33:38 +00:00
|
|
|
u*) pulsemixer --change-volume +"$num" ; $newvol ;;
|
|
|
|
d*) pulsemixer --change-volume -"$num" ; $newvol ;;
|
|
|
|
m*) pulsemixer --toggle-mute ; $newvol ;;
|
|
|
|
truemute) pulsemixer --mute ; $newvol ;;
|
|
|
|
play) mpc play ;;
|
|
|
|
n*) mpc next ;;
|
|
|
|
prev) mpc prev ;;
|
|
|
|
t*) mpc toggle ;;
|
|
|
|
p*) mpc pause ; pauseallmpv ;;
|
|
|
|
f*) mpc seek +"$num" ;;
|
|
|
|
b*) mpc seek -"$num" ;;
|
2018-12-01 19:34:14 +00:00
|
|
|
r*) mpc seek 0% ;;
|
2018-10-07 12:33:38 +00:00
|
|
|
*) cat << EOF
|
|
|
|
lmc: cli music interface for mpd and pulse for those with divine intellect too
|
|
|
|
grand to remember the mpc/pamixer commands.
|
|
|
|
|
|
|
|
Allowed options:
|
|
|
|
up NUM Increase volume (2 secs default)
|
|
|
|
down NUM Decrease volume (2 secs default)
|
|
|
|
mute Toggle mute
|
|
|
|
truemute Mute
|
|
|
|
next Next track
|
|
|
|
prev Previous track
|
|
|
|
toggle Toggle pause
|
|
|
|
truepause Pause
|
|
|
|
foward NUM Seek foward in song (2 secs default)
|
|
|
|
back NUM Seek back in song (2 secs default)
|
|
|
|
restart Restart current song
|
|
|
|
all else Print this message
|
|
|
|
|
|
|
|
All of these commands, except for \`truemute\`, \`prev\` and \`play\` can be truncated,
|
|
|
|
i.e. \`lmc r\` for \`lmc restart\`.
|
|
|
|
EOF
|
2018-05-07 16:07:47 +00:00
|
|
|
esac
|