From bb85b4795b5d3cd07c62c26b6040ab2935f313d8 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Jul 2019 00:17:34 +0200 Subject: init: New F5 mapping to reload UFO Chrome extension Reloads the UFO Chrome extension and opens a file in a single one-button mapping. --- init.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index dcea155..e87a1a7 100644 --- a/init.lua +++ b/init.lua @@ -34,9 +34,15 @@ 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) + hs.eventtap.keyStroke({'ctrl', 'option'}, 'u') + hs.timer.doAfter(0.5, function() + hs.eventtap.keyStroke({}, 'r') + end) + + hs.timer.doAfter(10, function() + hs.eventtap.keyStroke({'ctrl', 'option'}, 'o') + hs.timer.doAfter(0.5, function() + hs.eventtap.keyStroke({}, '0') + end) + end) end) -- cgit v1.2.3