#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

#3 in #caffeine

Download history 34/week @ 2024-06-24 41/week @ 2024-07-08 40/week @ 2024-07-15 61/week @ 2024-07-22 38/week @ 2024-07-29 37/week @ 2024-08-05 18/week @ 2024-08-12 32/week @ 2024-08-19 47/week @ 2024-08-26 51/week @ 2024-09-02 45/week @ 2024-09-09 32/week @ 2024-09-16 104/week @ 2024-09-23 84/week @ 2024-09-30 66/week @ 2024-10-07

288 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
~152K SLoC