tuxedocomputers / tuxedo-control-center

A tool to help you control performance, energy, fan and comfort settings on TUXEDO laptops.
GNU General Public License v3.0
488 stars 63 forks source link

Create a native version of TCC #167

Closed AaronErhardt closed 1 year ago

AaronErhardt commented 2 years ago

As #37 and #138 show, electron really isn't a good choice for a small app that handles a few settings. Actually, shipping a whole browser runtime for this purpose is a huge overhead.

I'd suggest to create a native Linux app instead. Ideally with flatpak support which could help with distro-comparability as well. Arguably with the likes of Relm4 and libadwaita native development on Linux has never been easier.

I'm willing to contribute if I can get some help with the hardware interface :)

tuxedoxt commented 2 years ago

Hello,

of course electron is a huge overhead :D ..has it's practicalities and we will most likely not rewrite it ;)

Optimizations are planned however! (tccd/driver -wise)

Also needed to be added maybe since I see some confusion. The tccd (service) part does not use electron, it is a nodejs application, with the overhead of.. nodejs, of course.

For any alternative implementations I'd recommend to just reuse the native c++ hardware communication part of TCC referred to as tuxedo_io_api in the code. It is pretty well abstracted from the rest and handles the communication with the driver.

Happy coding :)

AaronErhardt commented 2 years ago

Would it make sense to focus on tccd first then? It sounds like this is what people complained the most about and having a fancy native GUI isn't a big win if the underlying service runs slow. What exactly do you plan for optimizing it?

blitz commented 2 years ago

@AaronErhardt I would also be interested in rewriting tccd in Rust (or C++ if it has to be). If anyone starts that project, please ping me. The GUI is nice, but not really required for me either. I'm (trying to) keep TCC packaged for NixOS and the whole Javascript ecosystem is a huge pain in the backside with Electron being by far the worst part of it. :(

AaronErhardt commented 2 years ago

@blitz FYI: https://github.com/AaronErhardt/tuxedo-rs

The ioctl part is mostly implemented (at least the Clevo API, I don't what the difference is to Uniwill). I can definitely use some help, the C++/JS code is not hard to understand for the most part but sometimes it's hard to figure out what exactly the kernel driver does with certain ioctl commands.

n-tux-tmp commented 1 year ago

I wrote a small utility based on the work of @AaronErhardt to automatically regulate fan speed : https://git.42l.fr/neil/tuxedo-fancontrol Fan speed regulation is the tool’s only purpose, I don’t plan to make it a full-fledged alternative to TCC.

Also it is meant for personal use, but feel free to use it for yourself and improve it. I’ll need some help to define the algorithms used to smooth the fan speed increases/decreases.

AaronErhardt commented 1 year ago

@n-tux-tmp I'd love to work together with you on this project. I think I'll have some time over the next days to continue my work on tuxedo-rs.

FedericoCeratto commented 1 year ago

If anyone want to write an native implementation in Python, Rust, C, C++ or Nim under GPL3 I'd be happy to package and upload it in Debian, Ubuntu and derivatives.

AaronErhardt commented 1 year ago

I'm closing this because tuxedo-rs is now available as a native alternative: https://github.com/AaronErhardt/tuxedo-rs