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

Is it possible to add support for automatically disabling compilation when using battery mode on a laptop? #3631

Open
hengzhe-zhang opened this issue Aug 24, 2024 · 2 comments
Labels
enhancement New feature or (non bug related) change to the program.

Comments

@hengzhe-zhang
Copy link

Is it possible to add support for automatically disabling compilation when using battery mode on a laptop? I've noticed that with automatic compilation enabled, CPU usage is very high, and I frequently need to manually disable it to reduce battery consumption.

@hengzhe-zhang hengzhe-zhang added enhancement New feature or (non bug related) change to the program. untriaged Issue type still needs to be triaged or verified. labels Aug 24, 2024
@PHPirates
Copy link
Collaborator

Uh, good question. Is it possible with code to check if your laptop is in battery mode?

@hengzhe-zhang
Copy link
Author

Yes, it is possible to check whether the laptop is running on battery power using code, at least on Windows, by utilizing the following PowerShell script:

$powerStatus = Get-WmiObject -Query "SELECT * FROM Win32_Battery"
if ($powerStatus.BatteryStatus -eq 1) {
    Write-Output "Laptop is running on battery."
} else {
    Write-Output "Laptop is plugged in."
}

@PHPirates PHPirates removed the untriaged Issue type still needs to be triaged or verified. label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or (non bug related) change to the program.
Projects
None yet
Development

No branches or pull requests

2 participants