sidit77 / rusty-twinkle-tray

Twinkle Tray but RWIR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rusty Twinkle Tray

Rusty Twinkle Tray is a work-in-progress (WIP) rewrite of Twinkle Tray in Rust. A central goal of this rewrite is to start much faster so that monitor brightness can be adjusted as soon as possible after logging in.

Screenshot

image

Precompiled Binaries

Coming soon

Building

This program is written in Rust and therefore requires a working Rust installation if you want to compile it yourself.

This program can be built by simply running:

cargo build --release

Contributing

Toolkit

This program uses the default UWP Controls hosted inside an XAML island.

Unfortunately, the Microsoft-provided windows-rs crate does not include bindings for the Window.UI.Xaml namespace. To nevertheless use it with Rust, this project directly uses windows-bindgen to manually generate the missing bindings (libs/windows-ext). However, the generated bindings are quite large (~1.5m LOC; ~1m of that in a single file). To keep the IDE happy, this project additionally used a post-processor (/libs/codegen) that deletes many unused functions. The file libs/windows-ext/Codegen.toml controls which functions are kept. To regenerate the bindings after editing this file, simply run just update-bindings (requires just).

Todos

  • Settings window
  • Fluent design for Windows 11+
  • Respect Dark/Light system setting
  • Attempt to restore brightness after waking up from sleep
  • Support integrated laptop screens connected over I2C
  • Support monitor hot plugging
  • Handle auto hiding taskbar
  • Improve themes
  • Adapt icon to system theme
  • Correctly handle display scaling

License

MIT License

About

Twinkle Tray but RWIR

License:MIT License


Languages

Language:Rust 100.0%Language:Just 0.0%