From e5d639ea14c1c6b26b427fdfc570b00328cd504c Mon Sep 17 00:00:00 2001 From: Nico Boisselier Date: Tue, 14 Jun 2016 09:48:42 +0100 Subject: [PATCH] radio_play --- etc/profile.d/functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index b0e16f4f..35311c02 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -229,6 +229,12 @@ getexp() { } radio_play() { + local prog=`which player` + if [ -z "$prog" ]; then + case $OSTYPE in + darwin*) prog="open" ;; + esac + fi perl -e ' @_=grep{$_} split("\n"," FranceInter | http://audio.scdn.arkena.com/11008/franceinter-midfi128.mp3 @@ -250,7 +256,7 @@ if (@ARGV) { $play=shift @ARGV; } else { } $play eq "" && exit; @_ = $_[$play-1] =~ /^(.*?)\s*\|\s*(.*?)$/ or exit; print "[ $play - ".$_[0]." ]\n\n"; -exec "mplayer",$_[1]; +exec "'$prog'",$_[1]; ' "$@" } -- 2.47.3