Skip to content

Instantly share code, notes, and snippets.

@RobertAudi
Created July 5, 2010 18:40
Show Gist options
  • Select an option

  • Save RobertAudi/464586 to your computer and use it in GitHub Desktop.

Select an option

Save RobertAudi/464586 to your computer and use it in GitHub Desktop.
Save that code in a file called moc and put it somewhere in your $PATH
#!/bin/bash
# /!\ WARNING /!\
# ---------------
# DO NOT PUT THE CONTENTS OF THIS SCRIPT INTO
# A FUNCTION OR ELSE MOC WILL STOP RUNNING AS
# SOON AS YOU CLOSE THE TERMINAL WINDOW IN WHICH
# IT WAS FIRST LAUNCHED!!
number=$(ps aux | grep jackd | grep -v grep | wc -l)
# if jackd is not running, launch it because moc needs it.
# the -T option makes sure that jack quits when mocp quits
# so that it doesn't eat up cpu for nothing
if [[ ! $number -gt 0 ]]
then
jackd -T -d coreaudio &> /dev/null &
fi
mocp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment