Skip to content

Instantly share code, notes, and snippets.

@2shortplanks
Last active September 2, 2020 06:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 2shortplanks/6b851763a063cc6bc08047a5408387e2 to your computer and use it in GitHub Desktop.
Save 2shortplanks/6b851763a063cc6bc08047a5408387e2 to your computer and use it in GitHub Desktop.
Configure Karabiner Elements to control itunes volume / pause itunes. Install Karabiner-Elements from https://github.com/tekezo/Karabiner-Elements. Download this gist and put in `~/.config/karabiner/assets/complex_modifications`, then go to "Complex Modifications" tab, press "+ Add Rule" and then click Enable next to the rules
{
"title" : "iTunes direct",
"rules" : [
{
"manipulators" : [
{
"from" : {
"modifiers" : {
"mandatory" : [
"fn",
"shift"
]
},
"key_code" : "f11"
},
"type" : "basic",
"to" : [
{
"shell_command" : "osascript -e 'tell application \"iTunes\" to set sound volume to sound volume - 10'"
}
]
},
{
"to" : [
{
"shell_command" : "osascript -e 'tell application \"iTunes\" to set sound volume to sound volume + 10'"
}
],
"from" : {
"key_code" : "f12",
"modifiers" : {
"mandatory" : [
"fn",
"shift"
]
}
},
"type" : "basic"
}
],
"description" : "shift-fn-f11/f12 volume changes itunes volume"
},
{
"manipulators" : [
{
"from" : {
"modifiers" : {
"mandatory" : [
"fn",
"shift"
]
},
"key_code" : "f8"
},
"type" : "basic",
"to" : [
{
"shell_command" : "osascript -e 'tell application \"iTunes\" to pause'"
}
]
}
],
"description" : "shift-fn-f8 always pauses itunes"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment