From ab8d4c637552a1aa9db480fd4f7f60c8a47b80c3 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 31 Oct 2019 21:31:10 +0100 Subject: 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. --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'init.lua') 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) -- cgit v1.2.3