malob / DarkMode.spoon

Hammerspoon Spoon to enable, disable, and toggle DarkMode either manually, or on a schedule (by default enabled on sunset and disabled as sunrise).
3 stars 0 forks source link

start() and toggle() functions doesn't work #3

Closed andreiborisov closed 5 years ago

andreiborisov commented 5 years ago

When I try to use start() function with simple spoon.DarkMode.start() it doesn't work producing this output: init.lua:311: attempt to index a nil value (local 'self')

Similar problem occurs with toggle(): init.lua:299: attempt to index a nil value (local 'self')

malob commented 5 years ago

They are methods as opposed to functions. You need to call them with a semicolon e.g.: spoon.DarkMode:start()

andreiborisov commented 5 years ago

Ah, my bad, sorry😅