#nosleep #caffeine

nosleep-nix

Block power save mode cross platform

5 releases

0.2.1 Nov 20, 2022
0.2.0 May 8, 2022
0.2.0-rc.2 May 7, 2022
0.2.0-rc.1 May 4, 2022

#4 in #caffeine

Download history 60/week @ 2024-07-23 43/week @ 2024-07-30 26/week @ 2024-08-06 24/week @ 2024-08-13 45/week @ 2024-08-20 29/week @ 2024-08-27 58/week @ 2024-09-03 45/week @ 2024-09-10 31/week @ 2024-09-17 113/week @ 2024-09-24 82/week @ 2024-10-01 76/week @ 2024-10-08 69/week @ 2024-10-15 70/week @ 2024-10-22 94/week @ 2024-10-29 81/week @ 2024-11-05

339 downloads per month
Used in 2 crates (via nosleep)

MIT license

15KB
248 lines

nosleep-nix

Linux library to block the power save function and preventing the OS to sleep.


lib.rs:

Wrapper utility to block and unblock the Linux power save mode. It uses either the org.gnome.SessionManager D-Bus or the org.freedesktop.PowerManagement API under the hood.

Heavily inspired on the Chromium source code: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/services/device/wake_lock/power_save_blocker/power_save_blocker_linux.cc

Dependencies

~7MB
~153K SLoC