[GNU ELPA] New package: caffeinate-mode
Lucas Christian <[email protected]>
| Newsgroups | gmane.emacs.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
Long-time Emacs user, first-time contributing a package.
One of the more practical additions I am excited about in Emacs 31 is
the system-sleep package, which provides a native hook into the
operating system's power management APIs. Long-term, I suspect the
potential of system-sleep will come from it being integrated into many
Emacs workflows so that the user never has to think about preventing
their system from going to sleep while Emacs executes long-running
tasks. Until then, I wrote this package to get system-sleep in front of
many users by offering a simple proposition: it can replace the GUI or
external command line tool they are likely already using.
caffeinate-mode solves the simple and generic case of "I started some
long-running task (that doesn't integrate directly with the OS power
management APIs), I want to manually tell the system not to sleep so it
can complete without interruption". Users may already be using various
utilities for this such as "Caffeine" (GNOME extension or macOS app by
the same name), systemd-inhibit (Linux CLI tool), or caffeinate (macOS
equivalent). On previous versions of Emacs, I frequently found myself
launching "caffeinate" from M-x async-shell-command for these use cases.
Package description:
This package provides two global minor modes that can be toggled on
any time it would be inopportune for the system to sleep:
- caffeinate-mode blocks system idle sleep but allows the display to
sleep.
- display-caffeinate-mode blocks system idle sleep and also keeps the
display active.
The modes are mutually exclusive: enabling one automatically disables
the other. Disabling either mode releases the active power assertion,
allowing the system to resume its normal sleep behavior.
While the modes are active, Caffeinate signals your operating system
using its native power assertion APIs, using the facilities provided
by the system-sleep package.
If you frequently forget to disable caffeinate-mode, you can set a
timeout using caffeinate-set-timeout (or the options in the mode-line
menu) to ensure your system will eventually sleep.
Repository: https://github.com/lucasec/emacs-caffeinate
Dependencies: This package only works on Emacs 31+ (since Emacs 31 is
not released yet, I appreciate any advice on how to set the
Package-Requires line)
My intention is to submit this package to GNU ELPA. I do not currently
have an FSF copyright assignment on file but would be happy to complete
one.
Best,
Lucas
--
Lucas Christian
[email protected]