Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power prefference patch #2813

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

laycookie
Copy link

@laycookie laycookie commented Feb 22, 2025

Fixing the issue mentioned in #2810. Currently I'm doing so by looking at the reported chassis type on Linux, and requesting pc system type enum for windows, to determine if the device is low powered, or high powered. In the cases of platform not being either of them it defaults to Low Power, which shouldn't matter in case of Macs, and is a logical default in my head for an unknown OS.

@laycookie
Copy link
Author

laycookie commented Feb 23, 2025

So far tested it on windows, and Linux desktop. Both resulted in PowerPrefference being set to high, which is the desired outcome.

Comment on lines +90 to +92
let output = Command::new("cat")
.arg("/sys/class/dmi/id/chassis_type")
.output();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to call out to cat instead of normal fs io?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not really. I just used shell on windows, and decided to use it on Linux as well just for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants