tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
84.89k stars 2.56k forks source link

[feat] Power Monitor api or plugin like in electron #8968

Open rp1231 opened 8 months ago

rp1231 commented 8 months ago

Describe the problem

There's currently no power monitor api or plugin for tauri

Describe the solution you'd like

It would be nice if a power monitor api/plugin could be implemented like in electron: https://www.electronjs.org/docs/latest/api/power-monitor/

Alternatives considered

No response

Additional context

There were talks of a possible plugin on discord but that has not materialized yet.

FabianLars commented 8 months ago

/upstream tauri-apps/plugins-workspace

RandomEngy commented 8 months ago

Maybe https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/System/Power/fn.PowerRegisterSuspendResumeNotification.html would be of help here for the Windows side.

pewsheen commented 8 months ago

I did a similar project before, but I haven't maintained it for a while https://github.com/pewsheen/psp