DEV Community

Cover image for How to monitor & analyze your windows based system's battery?
Ujjwal Gupta
Ujjwal Gupta

Posted on

How to monitor & analyze your windows based system's battery?

Have you ever wondered about your system's capabilities especially battery capacity, estimated life, recent usages, overall state, etc?

I did and so I started looking for solutions online and after being completely exhausted by no good product in the market to fulfill my needs. I decided to build a tool called, Powir.

So, Powir is a Windows 10 based tool to monitor and analyze your system's power and battery usage.

It provides you with various information and statistics about the current and overall history of the power and battery usage of your system.

Powir is 100% free and completely open-source for anyone to download/build and use. :)

Installation is as simple as running:

curl -L https://github.com/SlapBot/powir/releases/download/v1.0.2/powir.1.0.2.exe --output powir.exe
./powir

There were various reasons behind building this tool such as:

๐Ÿ” Complete lack of any such power/battery monitoring analyzing tool available in the market.
โŒ Obscure documentation over how to find battery statuses on the Internet.
๐Ÿ˜– Native solution requires running commands from terminal which outputs unclear and not satisfactory reports of the system.

Hence, I decided to work on this mini-project to help the needs of everyone whether developer or not to get a clear picture of their system's capabilities.

๐Ÿƒโ€โ™€๏ธ 100% portable app with no installations required: download and run!
๐Ÿงน Provides you with a simple and clean UI to list your battery and system information.
๐Ÿ”‹ Shows you the trend in battery capacity as well estimate life since the OS was installed.
๐Ÿงพ Ability to export all the data via various formats: PDF (app), JSON (processed), HTML (original report)

Installation & Demo: https://www.youtube.com/watch?v=0nEu4neYHRM


If you're looking to build it from the source, inspect the app, or add new features - its extremely simple and you only have to follow few instructions as listed below:

Prerequisites

  • Git
  • Node
  • NPM

Setup

  • Clone the repository: git clone https://github.com/SlapBot/powir.git
  • Cd into the directory: cd powir and run: npm install

Build

  • Run npm run build which will package the app at dist/ folder.

Usage

Electron App

  • Run these two commands in two separate sessions when you are developing in order to use HMR (hot module reloading):
    • Run react server: npm run react-start
    • Run electron app: npm run electron-start
  • All of the server code is located at: public/server directory.
  • Entrypoint of the electron app is atpublic/electron.js.
  • Everything related to rendering is done at: src directory.
  • Any of the changes you make at src directory will reflect instantly in the app.
  • Any of the changes made for server requires the app to be restarted using: npm run electron-start

Browser Window App

  • Run npm run lite-mode which opens up a tab in your default browser again with HMR enabled.
  • Entrypoint of the browser window app is atpublic/browser.js.
  • Everything related to rendering is done at: src directory.
  • Any of the changes you make at src directory will reflect instantly in the app.
  • Any of the changes made for server requires the app to be restarted using: npm run lite-mode

๐Ÿ’– App is completely open source with all of the documentation available on Github at: https://github.com/SlapBot/powir/

๐Ÿค Follow me on Twitter for more updates or any query: https://twitter.com/ugupta41

๐Ÿš€ Relevant Product Hunt Launch: https://www.producthunt.com/posts/powir/

๐Ÿฅ‚ Hackernews Discussion: https://news.ycombinator.com/item?id=23515694

Top comments (1)

Collapse
 
spez profile image
Abhigyan

Nope. JavaScript isn't a good idea. Java with be better