Most active commenters

    ←back to thread

    700 points yen223 | 13 comments | | HN request time: 1.195s | source | bottom
    1. selectnull ◴[] No.42058087[source]
    TIL: caffeinate

    Very useful.

    replies(5): >>42058262 #>>42058366 #>>42058643 #>>42060502 #>>42063310 #
    2. vallode ◴[] No.42058262[source]
    Indeed, many applications I would expect to prevent sleeping (some audio playback ones, games, etc.) don't implement this. I assume it's a case of Apple's APIs changing over the years and not everyone catching up/caring. At one point I had downloaded Amphetamine[^1] but it is much nicer to just use the terminal here.

    [^1]: https://apps.apple.com/us/app/amphetamine/id937984704

    replies(2): >>42058327 #>>42058509 #
    3. m1keil ◴[] No.42058327[source]
    Also https://github.com/newmarcel/KeepingYouAwake
    4. keybored ◴[] No.42058366[source]
    I was able to install a `caffeine` package with Apt on Linux. In that one the `caffeinate` command is supposed to be run with another command. While the `caffeine` command does what macOs `caffeinate` does.
    5. galad87 ◴[] No.42058509[source]
    The "newest" and still supported low level API is almost 14 years old: https://developer.apple.com/documentation/iokit/kiopmasserti... https://developer.apple.com/documentation/iokit/kiopmasserti...
    6. huskyr ◴[] No.42058643[source]
    For a GUI version, Amphetamine is quite nice (and free). https://apps.apple.com/us/app/amphetamine/id937984704?mt=12
    replies(1): >>42058729 #
    7. neevans ◴[] No.42058729[source]
    yes amphetamine I use regularly when I want to charge my android phone during travel with lid closed.
    replies(1): >>42059905 #
    8. walthamstow ◴[] No.42059905{3}[source]
    That's interesting, I have never needed to do that. My Pixels have always just charged even if the lid is closed, on Intel and Apple Silicon machines. I like to travel light so I often use my laptop as a battery bank instead of carrying a seperate one.
    9. weberer ◴[] No.42060502[source]
    It would be cool to have this activate when a Jupyter notebook is currently running a cell, and deactivate automatically when its finished.
    replies(1): >>42064216 #
    10. al_borland ◴[] No.42063310[source]
    While it may avoid sleep, it doesn’t prevent inactivity, in my experience. For instance, my chat app at work will still show me inactive while running caffeinate. I have to do non-interactive training semi-regularly and need to interact to keep from looking like I’m away from my desk.
    replies(1): >>42063912 #
    11. latexr ◴[] No.42063912[source]
    Have you used the `-u` flag? From the manual:

      -u      Create an assertion to declare that user is active.
    replies(1): >>42065721 #
    12. eszed ◴[] No.42064216[source]
    This can be done by passing a PID. I believe there are other options, as well. (Not at my computer to look it up right now.) I haven't used those features "manually", but I have in scripts that I expect to generate long-running processes.
    13. mathieuh ◴[] No.42065721{3}[source]
    Doesn’t work with Slack at least. I’ve had an iTerm window running `caffeinate -disu` for years. I think it used to work and stopped working in the last few months.