aboutsummaryrefslogtreecommitdiffstats
path: root/init.lua
diff options
context:
space:
mode:
authorTeddy Wing2019-07-11 20:14:19 +0200
committerTeddy Wing2019-07-11 20:14:19 +0200
commitf27622ab0653f0790a7bc9217c53dd2f7eb66660 (patch)
tree6e05f3fbb84876dcd929a88a4fe255ab113acf1e /init.lua
parent5c606f8ecb78aa970546b2cf8f8b704599159469 (diff)
downloaddothammerspoon-f27622ab0653f0790a7bc9217c53dd2f7eb66660.tar.bz2
init: Add temporary F5 binding to reload a browser extension
Working on a Chrome extension that displays an HTML interface through an extension-scoped URL. When I reload the extension, the page gets closed automatically. This mapping clicks the extension's button in the Chrome toolbar (the rightmost extension icon) to reopen the page.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index b3baca8..dcea155 100644
--- a/init.lua
+++ b/init.lua
@@ -31,3 +31,12 @@ spoon.WindowMode:bindHotkeys({ mode = {{'ctrl', 'option'}, 'w'} })
hs.hotkey.bind({}, 'f8', function()
hs.eventtap.keyStroke({'cmd', 'option', 'ctrl'}, '8')
end)
+
+-- Temporary browser extension reload mapping
+hs.hotkey.bind({}, 'f5', function()
+ local position = hs.window.frontmostWindow():zoomButtonRect()
+ position.x = position.x + 925
+ position.y = position.y + 45
+
+ hs.eventtap.leftClick(position)
+end)