From 487ff34d75b034814a9b8bdd352e2ede38395c25 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 3 Mar 2021 20:11:17 +0100 Subject: ufo: Reload UFO extension with Extreload on F12 Easily reload the extension by pressing F12. --- ufo.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ufo.lua') diff --git a/ufo.lua b/ufo.lua index a14ff89..ae0e1ce 100644 --- a/ufo.lua +++ b/ufo.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2019 Teddy Wing +-- Copyright (c) 2019, 2021 Teddy Wing -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -14,6 +14,9 @@ -- along with this program. If not, see . +logger = hs.logger.new('ufo', 'debug') + + ufo_mode = hs.hotkey.modal.new({'ctrl', 'option'}, 'u', 'UFO') ufo_mode:bind({'ctrl', 'option'}, 'u', 'UFO Off', function() ufo_mode:exit() @@ -49,3 +52,11 @@ ufo_mode:bind({}, 'w', function() ufo_mode:exit() end) + + +-- Shortcut to reload the UFO extension using Extreload +hs.hotkey.bind({}, 'f12', function() + local output, status, type, rc = hs.execute('ufo-reload-extension', true) + + logger:d('reloaded UFO: ', output, status, type, rc) +end) -- cgit v1.2.3