Code Monkey home page Code Monkey logo

alternative-battery's Introduction

Alternative-Battery

An alternative battery indicator for Windows.

Synopsis

A very simple battery indicator for Windows devices that use some kind of battery. This program uses WMI to get the battery information periodically and puts that information in the system tray.

Motivation

My Windows 10 laptop battery indicator stopped updating the charge percentage, so I decided to write my own.

Installation

Compile:

csc.exe .\Battery.cs .\Run.cs

Run:

.\Run.exe

Commandline arguments

Descriptions

  • --color-outline color: Sets the battery's outline color
  • --color-background color: Sets the battery's background color
  • --color-normal-charge color: Sets the battery's normal charge color
  • --color-powersave-charge color: Sets the battery's powersave charge color
  • --color-low-charge color: Sets the battery's low charge color
  • --color-critical-charge color: Sets the battery's critical charge color
  • --interval seconds: The amount of seconds between the indicator's updates
  • --show-console: Switch for displaying the console

Example

.\Run.exe --color-outline 'Green' --interval 30 --show-console

Runs the indicator with a battery icon that has a green outline. The indicator is updated every 30 seconds. A console is shown if this is run through a shortcut.

Warnings

  • This is a VERY bare-bones solution
  • There is no guarantee that this will work
  • Do not rely on the existing code since it might change significantly at any point in the future
  • This battery indicator does not include all the functionality that the native Windows (10) battery indicator supports

Future improvements

  • Charging icon when charging
  • GUI for the settings
  • More information in the system tray, like "time to full charge" (when charging) or "time to depletion" (when discharging)

alternative-battery's People

Contributors

katas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.