[LAU] Toggle Jack Transport CLI

Yassin Philip philcm at gnu.org
Tue Nov 15 21:48:30 UTC 2016


On 15/11/16 21:40, Ralf Mardorf wrote:
> On Tue, 15 Nov 2016 21:31:02 +0000, Yassin Philip wrote:
>> On 15/11/16 16:08, Jeremy Jongepier wrote:
>>> On 11/15/2016 03:19 PM, Yassin Philip wrote:
>>>> But found no way to detect the transport status ; Is there a way to
>>>> know it?
>>> I use this very hacky script that I bind to my Play media key (I use
>>> openbox for this):
>>>
>>> ---
>>> #!/bin/bash
>>>
>>> function jack_transport_status() {
>>>     jack_showtime | head -n1 & &> /dev/null
>>> }
>>>
>>> if jack_transport_status | grep -q -i stopped
>>> then
>>>     echo play | jack_transport &> /dev/null
>>>     killall jack_showtime
>>> else
>>>     echo stop | jack_transport &> /dev/null
>>>     killall jack_showtime
>>> fi
>>> ---
>>>   
>> I can't get it to work, somehow it chokes at the showtime cmd, that
>> refuses to give back the prompt..? I mean, just exec
>> jack_transport_status in the shell should return, right?
> jack_transport_status is a function of his script, it quasi is an alias
> for jack_showtime | head -n1 & &> /dev/null. Actually you could add an
> alias to .bashrc or run from command line
>
>    jack_showtime | head -n1 &
>
> &> /dev/null is the same as  >/dev/null 2>&1 , it redirects STDERR and
> STDOUT to /dev/null, IOW all output is invisible.
Ah, sorry, it works now, it's just that I was executing it in a ZSH env. 
It needs to be a bash script. Thanks everyone, I got my transport toggle 
now! It's disturbingly hacky, but it works :)
> _______________________________________________
> Linux-audio-user mailing list
> Linux-audio-user at lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-audio-user

-- 
Yassin Philip - New album out NOW
http://yassinphilip.bitbucket.org



More information about the Linux-audio-user mailing list