aboutsummaryrefslogtreecommitdiffstats
path: root/init.lua
diff options
context:
space:
mode:
authorTeddy Wing2019-10-31 21:31:10 +0100
committerTeddy Wing2019-10-31 21:34:42 +0100
commitab8d4c637552a1aa9db480fd4f7f60c8a47b80c3 (patch)
tree3e9cb89ae236df617a479d7211f83429b64af1be /init.lua
parent7662961f51819d6db27ec09cb0845b7060ab4206 (diff)
downloaddothammerspoon-ab8d4c637552a1aa9db480fd4f7f60c8a47b80c3.tar.bz2
init: Reset brightness in F8 invert screen colours binding
Mac OS X 10.15 Catalina sometimes (but not always) causes the internal display's brightness to change to the maximum when connected to an external monitor after inverting screen colours. In our F8 shortcut which inverts screen colours, reset the screen brightness to correct this idiocy.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 7a65cd8..4d7d713 100644
--- a/init.lua
+++ b/init.lua
@@ -32,4 +32,11 @@ spoon.WindowMode:bindHotkeys({ mode = {{'ctrl', 'option'}, 'w'} })
-- Shortcut to invert screen colours
hs.hotkey.bind({}, 'f8', function()
hs.eventtap.keyStroke({'cmd', 'option', 'ctrl'}, '8')
+
+ -- Counteract a Catalina bug where sometimes inverting screen colours with
+ -- an external monitor connected makes the internal monitor's brightness
+ -- change to 100%.
+ if hs.screen.primaryScreen():name() ~= 'G247HL' then
+ cbb_brightness_restore()
+ end
end)