Add led indicator setting, use one setting for notifications, move it under general

This commit is contained in:
dec05eba
2025-11-07 22:05:14 +01:00
parent be07070789
commit 70df557c2b
13 changed files with 291 additions and 168 deletions

27
include/LedIndicator.hpp Normal file
View File

@@ -0,0 +1,27 @@
#pragma once
#include <X11/Xlib.h>
#include <mglpp/system/Clock.hpp>
namespace gsr {
class LedIndicator {
public:
LedIndicator(Display *dpy);
LedIndicator(const LedIndicator&) = delete;
LedIndicator& operator=(const LedIndicator&) = delete;
~LedIndicator();
void set_led(bool enabled);
void blink();
void update();
private:
void update_led(bool new_state);
private:
Display *dpy = nullptr;
Atom scroll_lock_atom = None;
bool led_indicator_on = false;
bool led_enabled = false;
bool perform_blink = false;
mgl::Clock blink_timer;
};
}