feat(wayland): add idle inhibitor for wayland

This commit is contained in:
2025-09-21 23:46:57 -04:00
parent 6e075bff4a
commit ee2df36041
5 changed files with 301 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
#include "log.h"
#include "led.h"
#include "wayland.h"
#include "acpi.h"
#include "utils.h"
@@ -86,8 +87,11 @@ on_battery_event(char *percent, bool plugged)
} else {
led_set_rate(0);
}
wayland_set_idle_lock(false);
} else {
led_set_rate(0);
wayland_set_idle_lock(true);
}
free(percent);
@@ -109,6 +113,9 @@ main(int argc, char *argv[])
/* create the led thread */
led_create_thread((char *)ledfile);
/* create the wayland thread */
wayland_create_thread();
/* run events that need to be run on start to ensure that the current state
* inside the program reflects that that is outside the program
*/