Skip to content

Instantly share code, notes, and snippets.

@shkm shkm/private.xml
Last active Aug 29, 2015

Embed
What would you like to do?
Hook up MPD (MPC) to work with the CM Storm Ninja (And Filcos?) in Karabiner.
<?xml version="1.0"?>
<root>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_SHELL_mpc_playpause</name>
<url type="shell">
<![CDATA[
MPC=/usr/local/bin/mpc
if $MPC status | grep -q 'playing'
then
$MPC pause
else
$MPC play
fi
]]>
</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_SHELL_mpc_previous</name>
<url type="shell">
<![CDATA[ /usr/local/bin/mpc prev ]]>
</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_SHELL_mpc_next</name>
<url type="shell">
<![CDATA[ /usr/local/bin/mpc next ]]>
</url>
</vkopenurldef>
<item>
<name>Make Play/Pause work with MPD.</name>
<identifier>private.play_pause_mpd</identifier>
<autogen>
__KeyToKey__
ConsumerKeyCode::MUSIC_PLAY,
KeyCode::VK_OPEN_URL_SHELL_mpc_playpause
</autogen>
</item>
<item>
<name>Make Previous work with MPD.</name>
<identifier>private.mpc_previous</identifier>
<autogen>
__KeyToKey__
ConsumerKeyCode::MUSIC_PREV_0x12,
KeyCode::VK_OPEN_URL_SHELL_mpc_previous
</autogen>
</item>
<item>
<name>Make Next work with MPD.</name>
<identifier>private.mpc_next</identifier>
<autogen>
__KeyToKey__
ConsumerKeyCode::MUSIC_NEXT_0x11,
KeyCode::VK_OPEN_URL_SHELL_mpc_next
</autogen>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.