mirror of
https://github.com/Xevion/smart-rgb.git
synced 2025-12-05 23:16:23 -06:00
2.5 KiB
2.5 KiB
story
I like to write a short story of a repository's development sometimes.
Sketching and Testing
Right now, I have a rough sketch of what my software is going to need, and what it's going to do.
- I might use this Tokio framework for idling and receiving notices while processing events. It seems like overkill, but if I plan to use an automatic configuration reader, than it'd be useful.
- I am unsure at this time how to process and log events.
- Currently, creating a Windows service might be fast, but it also seems to make development slow.
- Would supporting a separate stage Windows process be difficult? It seems like creating a service is just a bunch of boilerplate for running a process.
- The process shows up in Task Manager like normal anyways.
- I'm unsure right now how to properly abstract the sleep/lock/idle states in both Windows and Linux. This might be really hard and annoying. Uggg.
Resources:
- Minosse - Windows Service in Rust for setting Process Affinities automatically
- windows_service Crates.io Docs
- windows_rs/samples
- Service Control Handler Function
- Event Logging using Rust in Windows
- daemonize Crates.io
- SO - How to Programatically Detect When the OS Windows Is Waking Up or Going to Sleep
- Tauri Discussion - Power Monitor api or plugin like in electron
- Using WinAPI in Rust to Manage Windows Services
Service vs Window
So initial studies were pretty confusing as most of the solutions for detecting changes in lock screen or sleep mode used Wndproc, which is a callback installed when creating a Window; a solution that I really wasn't interested in.
On top of being complex as hell, it required hiding the window manually using special SW_HIDE magic, and it sounded wrong. Also, I don't think services should have windows at all.