Hammerspoon / Spoons

The official repository of Spoon plugins
https://www.hammerspoon.org/Spoons/
453 stars 141 forks source link

AClock does not show correct time at first #274

Closed dmgerman closed 1 year ago

dmgerman commented 2 years ago

The time should be updated before it is shown. Otherwise it shows at first incorrect time (it will take around 1-2 seconds to update). The following line of code fixes that:

diff --git a/Source/AClock.spoon/init.lua b/Source/AClock.spoon/init.lua
index ad9db51..836c991 100644
--- a/Source/AClock.spoon/init.lua
+++ b/Source/AClock.spoon/init.lua
@@ -100,6 +100,7 @@ end
 --- Returns:
 ---  * The AClock object
 function obj:show()
+  self.canvas[1].text = os.date(self.format) 
   self.canvas:show()
   self.tick_timer = self:tick_timer_fn()
   if self.hotkey then