Skip to content

Instantly share code, notes, and snippets.

@kidd
Created April 29, 2024 10:17
Show Gist options
  • Save kidd/d11508241f7c497450e95c7cf4392d7d to your computer and use it in GitHub Desktop.
Save kidd/d11508241f7c497450e95c7cf4392d7d to your computer and use it in GitHub Desktop.
-- https://github.com/Hammerspoon/hammerspoon/issues/664
slack_c_n = hs.hotkey.new({"ctrl"}, 'n', function()
hs.eventtap.keyStroke({}, 'down')
end)
slack_c_p = hs.hotkey.new({"ctrl"}, 'p', function()
hs.eventtap.keyStroke({}, 'up')
end)
hs.window.filter.new('Slack')
:subscribe(hs.window.filter.windowFocused,function() slack_c_n:enable() end)
:subscribe(hs.window.filter.windowUnfocused,function() slack_c_n:disable() end)
hs.window.filter.new('Slack')
:subscribe(hs.window.filter.windowFocused,function() slack_c_p:enable() end)
:subscribe(hs.window.filter.windowUnfocused,function() slack_c_p:disable() end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment