From 1e93fb1160347e77366ea0dcf1e846fe8b738672 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 5 Nov 2014 07:07:01 +0800 Subject: make the instruction more friendly to mac users --- README.rst | 14 ++++++++++++-- com.ted.mpd_trigger.plist | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 com.ted.mpd_trigger.plist diff --git a/README.rst b/README.rst index 5f00782..9af13df 100644 --- a/README.rst +++ b/README.rst @@ -55,6 +55,16 @@ the following command: .. image:: https://raw.githubusercontent.com/Determinant/mpd_trigger/master/screenshot.png +If you have idea about how to run this program as a user daemon, try to copy +the accompanied file ``com.ted.mpd_trigger.plist`` (you may modify the file to +have correct parameters for mpd_trigger) to +``path_to_your_home/Library/LaunchAgents`` and then execute the following commands: + +:: + + cd path_to_your_home/Library/LaunchAgents + launchd load com.ted.mpd_trigger.plist + Finally, it is worth mentioning that patterns can be nested, for example a part of the pattern in last example ``{track?{track}:unkown track}`` makes use of such technique. Have fun! :) @@ -64,7 +74,7 @@ such technique. Have fun! :) Dependencies ------------ -- The canonical mpd library: libmpdclient (on which famous mpd clients such as - mpc and ncmpcppp also depends) +- The canonical mpd library: ``libmpdclient`` (on which famous mpd clients such as + mpc and ncmpcppp also depend) - Some basic POSIX syscalls (ubiquitous on current unix-like systems) - Nothing else. diff --git a/com.ted.mpd_trigger.plist b/com.ted.mpd_trigger.plist new file mode 100644 index 0000000..36b209e --- /dev/null +++ b/com.ted.mpd_trigger.plist @@ -0,0 +1,16 @@ + + + + + Label + com.ted.mpd_trigger + ProgramArguments + + /Users/ymf/Downloads/mpd_trigger/mpd_trigger + -e + /usr/local/bin/terminal-notifier -title "{title}: {state} ({elapsed_pct}%)" -subtitle "{artist}" -message "{album} @ {track?{track}:unknown track}" -sender com.apple.iTunes + + RunAtLoad + + + -- cgit v1.2.3-70-g09d2