From 215e927ac37f6a8e39b4f4e00b141fd39922f150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20G=C3=B6k=C3=A7in?= Date: Fri, 8 Nov 2024 11:07:19 +0100 Subject: [PATCH] feat: stop media buttons from starting apple music --- other/karabiner/karabiner.json | 117 ++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) diff --git a/other/karabiner/karabiner.json b/other/karabiner/karabiner.json index e733c91e..2a00d99f 100644 --- a/other/karabiner/karabiner.json +++ b/other/karabiner/karabiner.json @@ -3,6 +3,119 @@ { "complex_modifications": { "rules": [ + { + "description": "⏪ (back track) key should only control Spotify.", + "manipulators": [ + { + "from": { "key_code": "f7" }, + "to_if_alone": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to back track'" + } + ], + "to_if_held_down": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to rewind'" + } + ], + "type": "basic" + } + ] + }, + { + "description": "⏯ (play/pause) key should only control Spotify.", + "manipulators": [ + { + "from": { "key_code": "f8" }, + "to": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to playpause'" + } + ], + "type": "basic" + } + ] + }, + { + "description": "⏩ (next track) key should only control Spotify.", + "manipulators": [ + { + "from": { "key_code": "f9" }, + "to_if_alone": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to next track'" + } + ], + "to_if_held_down": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to fast forward'" + } + ], + "type": "basic" + } + ] + }, + { + "description": "Fn+⏪ (back track) key should only control Spotify.", + "manipulators": [ + { + "from": { + "key_code": "f7", + "modifiers": { "mandatory": ["fn"] } + }, + "to_if_alone": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to back track'" + } + ], + "to_if_held_down": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to rewind'" + } + ], + "type": "basic" + } + ] + }, + { + "description": "Fn+⏯ (play/pause) key should only control Spotify.", + "manipulators": [ + { + "from": { + "key_code": "f8", + "modifiers": { "mandatory": ["fn"] } + }, + "to": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to playpause'" + } + ], + "type": "basic" + } + ] + }, + { + "description": "Fn+⏩ (next track) key should only control Spotify.", + "manipulators": [ + { + "from": { + "key_code": "f9", + "modifiers": { "mandatory": ["fn"] } + }, + "to_if_alone": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to next track'" + } + ], + "to_if_held_down": [ + { + "shell_command": "osascript -e 'tell application \"Spotify\" to fast forward'" + } + ], + "type": "basic" + } + ] + }, { "description": "For VSCode, VSCode Insiders, and Cursor: Function keys (F1-F12) act as standard function keys. Pressing fn + Function key performs the corresponding media function.", "manipulators": [ @@ -449,8 +562,8 @@ "from": { "key_code": "caps_lock" }, "to": [{ "key_code": "escape" }] } - ] + ], + "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } } ] } -