#!/bin/sh # # If one tries to open any file with the extensions ".jack" # it tries to connect to a Jack source with the basename of the filename # (i.e. the filename without path and extension). case $1 in play) source=$(basename "$(echo -n "$2" | head -c -5)") echo -e "\n======= Connectiong to Jack source: $source =======" 1>&2 # ecasound -q -i jack_auto,"$source" -o stdout ecasound -q -B:rt -b:0 -z:nodb -z:nointbuf -i jack_auto,"$source" -o stdout exit 0 ;; isOurFile) extensions=$(echo -n "$2" | tail -c 5) if [ "x$extensions" == "x.jack" ]; then exit 0 else exit 1 fi ;; esac exit 1