#!/bin/sh # adjusted example shipped with cmus output() { # write status to ${TMP}/cmus-status (not very useful though) echo "$*" > ${TMP}/cmus-status 2>&1 echo "$*" > /tmp/cmus-status 2>&1 if [[ "$*" != ' - ' ]];then echo "$*" | sed -e 's/np: //g' >> ${TMP}/cmus-stats 2>&1 fi # WMI (http://wmi.modprobe.de/) #wmiremote -t "$*" &> /dev/null } while test $# -ge 2 do eval _$1='$2' shift shift done if test -n "$_file" then if (test -n "$_artist") || (test -n "$_title") then output "np: $_artist - $_title" else output "np: $(basename "$_file" .mp3)" fi else output "np: $_url - $_title" fi