Created
December 13, 2021 18:11
-
-
Save huytd/20f98ecb2bf1d76b4de9f6c21f5fb37c to your computer and use it in GitHub Desktop.
Media control with Hammerspoon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Alt + ] = Next song | |
hs.hotkey.bind({"alt"}, "]", function() | |
hs.eventtap.event.newSystemKeyEvent('NEXT', true):post() | |
hs.eventtap.event.newSystemKeyEvent('NEXT', false):post() | |
end) | |
-- Alt + [ = Prev song | |
hs.hotkey.bind({"alt"}, "[", function() | |
hs.eventtap.event.newSystemKeyEvent('PREVIOUS', true):post() | |
hs.eventtap.event.newSystemKeyEvent('PREVIOUS', false):post() | |
end) | |
-- Alt + \ = Play / Pause | |
hs.hotkey.bind({"alt"}, "\\", function() | |
hs.eventtap.event.newSystemKeyEvent('PLAY', true):post() | |
hs.eventtap.event.newSystemKeyEvent('PLAY', false):post() | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment