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
Owner

This rewrites the functionality we already had for scheduling Hyprsunset using hourly timestamps into a C++ plugin. Functionality should be the same.

It still doesn't store or capture the real state of the hyprsunset process, this is because there's no way to request whether or not hyprsunset has identity active or not, using hyprctl ipc calls.
The best that we could do is to not set identity when turning "off" hyprsunset, and instead set a temperature that is close to (but not quite) identity. That way it could use hyprctl hyprsunset temperature output to determine a real on/off state rather than manually setting a boolean for those states.

This rewrites the functionality we already had for scheduling Hyprsunset using hourly timestamps into a C++ plugin. Functionality should be the same. It still doesn't store or capture the *real* state of the `hyprsunset` process, this is because there's no way to request whether or not `hyprsunset` has `identity` active or not, using `hyprctl` ipc calls. The best that we could do is to not set `identity` when turning "off" hyprsunset, and instead set a temperature that is close to (but not quite) identity. That way it could use `hyprctl hyprsunset temperature` output to determine a real on/off state rather than manually setting a boolean for those states.
zach added 1 commit 2026-06-02 16:12:25 +02:00
rewrite the manager responsible for handling automatic hyprsunset temperature activation as a qml plugin
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 13s
Python / lint-format (pull_request) Successful in 19s
Python / test (pull_request) Successful in 50s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m2s
d246ba1800
zach requested review from AramJonghu 2026-06-02 16:12:25 +02:00
zach requested review from Inorishio 2026-06-02 16:12:25 +02:00
Collaborator

I presume that this would theoretically offset some system resources since C++ would be more efficient? I mean, likely negligible. Will test later.

I presume that this would theoretically offset some system resources since C++ would be more efficient? I mean, likely negligible. Will test later.
Author
Owner

Due to how small in scale the original code was I think it'd be pretty difficult to see much performance gain with this plugin. I also didn't write it having "performance-first" in mind. But maybe by some metric it's better.

Due to how small in scale the original code was I think it'd be pretty difficult to see much performance gain with this plugin. I also didn't write it having "performance-first" in mind. But maybe by some metric it's better.
Collaborator

Yea, I have no specific expectation at all.

Yea, I have no specific expectation at all.
Author
Owner

There's currently a bug where the Manager doesn't set identity on initialization if current time is outside scheduled time. I will probably fix this by using a three-state enum rather than boolean.

There's currently a bug where the Manager doesn't set `identity` on initialization if current time is outside scheduled time. I will probably fix this by using a three-state enum rather than boolean.
AramJonghu reviewed 2026-06-03 00:30:50 +02:00
AramJonghu left a comment
Collaborator

Functionally works. Nothing out of the ordinary in the logs. Code looks fine too.

Since there is a bug, I'd say to resolve that, then it is as good as approved.

Functionally works. Nothing out of the ordinary in the logs. Code looks fine too. Since there is a bug, I'd say to resolve that, then it is as good as approved.
zach added 1 commit 2026-06-03 18:02:28 +02:00
Merge branch 'main' into hyprsunset-manager-rewrite
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 15s
Python / lint-format (pull_request) Successful in 23s
Python / test (pull_request) Successful in 54s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m4s
0be98a64ac
zach added 1 commit 2026-06-03 23:21:13 +02:00
do not use apply() in initializer
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 17s
Python / test (pull_request) Successful in 48s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m4s
6586cc2788
zach added 1 commit 2026-06-04 14:56:54 +02:00
Merge branch 'main' into hyprsunset-manager-rewrite
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 24s
Python / test (pull_request) Successful in 42s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m3s
9168b6e893
zach added 1 commit 2026-06-04 15:05:23 +02:00
fix applying end() on init
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 23s
Python / test (pull_request) Successful in 49s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m3s
94f2cf076c
zach merged commit e127928126 into main 2026-06-04 15:05:46 +02:00
zach deleted branch hyprsunset-manager-rewrite 2026-06-04 15:05:48 +02:00
Sign in to join this conversation.