#nosleep #caffeine #powersave

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

#1 in #nosleep

Download history 65/week @ 2024-11-17 66/week @ 2024-11-24 96/week @ 2024-12-01 71/week @ 2024-12-08 49/week @ 2024-12-15 4/week @ 2024-12-29 16/week @ 2025-01-05 32/week @ 2025-01-12 14/week @ 2025-01-19 3/week @ 2025-01-26 24/week @ 2025-02-02 22/week @ 2025-02-09 32/week @ 2025-02-16 30/week @ 2025-02-23 31/week @ 2025-03-02

123 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
~154K SLoC