Macchina-CLI / libmacchina

A library providing access to all sorts of system information.
https://crates.io/crates/libmacchina
MIT License
68 stars 20 forks source link

[Feature] Windows related improvements #112

Open rashil2000 opened 2 years ago

rashil2000 commented 2 years ago

Hi!

I've recently started learning Rust, and I'd like to help out by improving macchina on Windows. I have a decent background in fetching system information - I'm a maintainer of winfetch (you might remember me from this thread).

This is the current state of macchina on Windows:

image

I believe the Packages readout was fixed recently - #105, #107.

But from the remaining 8 warnings, 5 readouts, namely Terminal, Shell, Backlight, Resolution and ProcessorLoad are relevant and possible to implement (and fairly easy too, at least from a CLI perspective, not sure about the Rust implementation since I'm new to it).

I see that the wmi dependency was recently added - #97. This is great! WMI contains a goldmine of information and we use it heavily in winfetch[^1].

For both Resolution and Backlight, we can use WMI - see here and here.

I will try to implement the Backlight function first.

[^1]: 10 function calls to Get-CimInstance as of now.

grtcdr commented 2 years ago

Thank you for offering to help :heart:

I certainly would love to see more and more readouts get implemented for Windows, as its current state is pretty unfortunate, to say the least... I am very confident though that the Windows implementation will only improve over time, since we've got @FantasyTeddy helping out.

I personally can't promise to work on Windows, but I am around (most of the time) to answer any questions, and review any PRs you might send our way.

grtcdr commented 2 years ago

Before you start hacking away at libmacchina, I highly suggest that you take a look at #110 and to tell us your thoughts. If the RFC succeeds to convince our contributors and team, #111 will be merged and it comes with a truckload of API breakages and an entire/major refactor of the codebase.

rashil2000 commented 2 years ago

I tend to agree with this comment there:

In other words, application developers that are interested in libmacchina can either use all the readouts we offer (by default), or cherry-pick the readouts they want to use.

Since libmacchina was originally intended for use with macchina itself (I assume), it'd be good to have everything available as default, with the ability to selectively turn off features if developers require.

grtcdr commented 2 years ago

Yeah, that is currently how it works in #111, I'll drop a video of the progress so we can visualize the changes.