diff options
author | Teddy Wing | 2019-07-11 20:14:19 +0200 |
---|---|---|
committer | Teddy Wing | 2019-07-11 20:14:19 +0200 |
commit | f27622ab0653f0790a7bc9217c53dd2f7eb66660 (patch) | |
tree | 6e05f3fbb84876dcd929a88a4fe255ab113acf1e /init.lua | |
parent | 5c606f8ecb78aa970546b2cf8f8b704599159469 (diff) | |
download | dothammerspoon-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.lua | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) |