xyproto/wallutils

Rewrite the event system (used by `settimed`)

xyproto opened this issue · 4 comments

  • The event system should be refactored out from both gnometimed and simpletimed.
  • When using settimed, the transition over midnight (23:59 to 00:00) is not handled correctly.
  • The length of the cross-fade transitions are not always handled correctly (results in messages like Triggered transition event at 13:20 (277% complete)).
  • Perhaps someone have already written a great even system in Go? I considered using something like cron or the systemd trigger system instead, but I think it would be nice if everything that has t o do with events was contained within a module that could be used by the settimed application.
  • Under sway, sometimes multiple events are triggered in rapid succession, which is not correct.

I created a new event system.

Using this package instead will hopefully fix the current issues.

I found gocron, an event scheduler, which might help. It's forked from a repo with 2k stars after the previous developer stopped maintaining it, and seems more flexible than event2.

Thanks! I will consider using it. event2 was written especially with settimed in mind, with as little complexity (and flexibility) as possible, just as much as is needed. If that doesn't work out, I'll probably use gocron instead.

I have rewritten the event system and updated the settimed command.