Rewrite the manager responsible for handling automatic hyprsunset temperature activation as a qml plugin #117

Merged
zach merged 5 commits from hyprsunset-manager-rewrite into main 2026-06-04 15:05:46 +02:00
2 changed files with 9 additions and 4 deletions
Showing only changes of commit 94f2cf076c - Show all commits
@@ -104,10 +104,12 @@ void HyprsunsetManager::toggle() {
}
void HyprsunsetManager::start() {
if (m_enabled)
if (m_enabled && m_initialized)
return;
m_initialized = true;
m_enabled = true;
emit enabledChanged();
m_process.setProgram("hyprctl");
@@ -116,10 +118,12 @@ void HyprsunsetManager::start() {
}
void HyprsunsetManager::end() {
if (!m_enabled)
if (!m_enabled && m_initialized)
return;
m_initialized = true;
m_enabled = false;
emit enabledChanged();
m_process.setProgram("hyprctl");
@@ -48,10 +48,11 @@ void manualToggleChanged();
private:
int m_startTime;
int m_endTime;
bool m_enabled;
bool m_enabled = false;
bool m_manualToggle = false;
bool m_activeAuto;
bool m_startAllowed;
bool m_startAllowed = false;
bool m_initialized = false;
QTimer m_startCooldown;
int m_temp;
QProcess m_process;