rdp / os

The OS gem allows for some easy telling if you’re on windows or not. OS.windows? as well as some other helper utilities
MIT License
145 stars 33 forks source link

detect OS sleep state #35

Closed bigbgh closed 4 years ago

bigbgh commented 5 years ago

Feature request - detect when the OS is sleeping and waking. My particular interest is on macOS.

rdp commented 5 years ago

So you want like a callback when the computer goes to sleep? Hmm that might require some ffi magic...

On Fri, Jun 14, 2019 at 1:49 AM bigbgh notifications@github.com wrote:

Feature request - detect when the OS is sleeping and waking. My particular interest is on macOS.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rdp/os/issues/35?email_source=notifications&email_token=AAADBUE7XYGUFTMBADA4RW3P2NERTA5CNFSM4HYFL6K2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZPVQLQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAADBUACXL7H3BTGB6WYFBLP2NERTANCNFSM4HYFL6KQ .

bigbgh commented 5 years ago

The use case I had in mind was the BitBar WorkTime plugin...because I usually forget to stop or pause before shutting my laptop. I thought it would be great to auto pause when it gets the sleep signal upon shutting the lid. However, now I'm thinking an easier approach might be to just start a timer and that should automatically stop when it goes to sleep. Haven't got a chance to test it yet.

On Sat, Jun 15, 2019 at 6:54 AM Roger Pack notifications@github.com wrote:

So you want like a callback when the computer goes to sleep? Hmm that might require some ffi magic...

On Fri, Jun 14, 2019 at 1:49 AM bigbgh notifications@github.com wrote:

Feature request - detect when the OS is sleeping and waking. My particular interest is on macOS.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/rdp/os/issues/35?email_source=notifications&email_token=AAADBUE7XYGUFTMBADA4RW3P2NERTA5CNFSM4HYFL6K2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZPVQLQ , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAADBUACXL7H3BTGB6WYFBLP2NERTANCNFSM4HYFL6KQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rdp/os/issues/35?email_source=notifications&email_token=AGJKQQHQNSX6LTJGOBTZIGDP2RAEVA5CNFSM4HYFL6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXYNSFY#issuecomment-502323479, or mute the thread https://github.com/notifications/unsubscribe-auth/AGJKQQHODZI5G7QZX4UTGZ3P2RAEVANCNFSM4HYFL6KQ .

bigbgh commented 4 years ago

Started using Toggl.