dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Hammerspoon Mortality script has issues with computer sleeping

Open sprice opened this issue 8 years ago • 8 comments

I realize that opening an issue against your personal dotfiles might be annoying. But maybe you're also experiencing this same problem 😄

I find that if my computer sleeps for some time, when I bring it back the mortality number hasn't updated. I need to reload my Hammerspoon config manually to get the current number.

Note: It's possible this isn't a sleep issue, I simply find that there are times during the day that I notice I have more time to live than expected so I reload the config and am met with the cold hard truth.

sprice avatar Jan 18 '18 19:01 sprice

Thanks for the bug report :^D

I've noticed this too, I think it might be an issue with Hammerspoon's hs.timer.doEvery not handling the system going to sleep properly. I'll leave this issue open as a reminder to check it out!

af avatar Jan 19 '18 17:01 af

I can't handle this... 😨

jordanj77 avatar Apr 16 '19 16:04 jordanj77

@jordanj77 can't handle this specific issue with the Mortality script, or more generally can't handle that there is a Mortality script 😹

sprice avatar Apr 16 '19 18:04 sprice

Haha I was wondering the same thing!

af avatar Apr 16 '19 18:04 af

I'm seeing an uncaught exception Error: EXISTENTIAL_CRISIS.

Can't pin down the precise reason, but it seems to go away if I shorten the updateText function to menu:setTitle('∞').

jordanj77 avatar Apr 16 '19 19:04 jordanj77

@jordanj77 I believe you're conflating an existential crisis with stoic philosophy 😉

sprice avatar Apr 16 '19 19:04 sprice

@sprice Oops, looks like I need to npm update my philosophy module... nice catch 😄

jordanj77 avatar Apr 16 '19 20:04 jordanj77

@jordanj77 My lua is a bit rusty, but have you tried this patch?

hs.timer.doEvery(ONE_DAY, function()
  self:mementoMori()
end)

af avatar Apr 17 '19 20:04 af