Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media Key support? #24

Open
brentr opened this issue Aug 31, 2018 · 1 comment
Open

Media Key support? #24

brentr opened this issue Aug 31, 2018 · 1 comment

Comments

@brentr
Copy link

brentr commented Aug 31, 2018

Is there any plan to add basic support for media keyboard keys like pause/stop/play/next/previous?

I'd be interested in adding this if you have no immediate plans to do so.

@brentr
Copy link
Author

brentr commented Sep 19, 2018

In the meantime, this little shell script works surprisingly well:

#!/bin/sh
#pause/pay current radio stream
: ${radio:=radiotray-lite}
case "$1" in
 play)
  killall -CONT $radio
;;
 stop)
  killall -STOP $radio
;;
 pause)
  pid=`pidof $radio` || {
   echo "No active $radio process" >&2
   exit 1
  }
  signal=STOP
  [ `ps -o state= -p $pid` = T ] && signal=CONT
  kill -$signal $pid
;;
 *) self=`basename $0`
    cat 2>&1 <<END
$self play, stop, or pause $radio process -- 9/15/18 brent@mbari.org
$self pause toggles between $self play and $self stop
END
esac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant