GithubHelp home page GithubHelp logo

kde_batterybar's Introduction

Battery bar for KDE Plasma

Description

This plasmoid adds a battery bar to the background of a KDE Plasma panel. Add it to the beginning of a panel or place it in a spot of choosing and adjust the offset accordingly in the config.

Screenshots

Screenshot here Screenshot here Screenshot here

Usage

The trick used is an overflow of the QML widget's elements into its container. The applet itself is a small rectangle, however the bars are significantly larger than the container advertised to KDE Plasma. The container's size can be modified via a setting called Container size to create a separator of adjustable width.

The applet adds two battery bars:

  • main bar (green by default) - fills the screen based on the percentage of power left in the battery,
  • auxillary bar (red by default) - its length represents the battery percentage that will be used during the next hour (by default) at current power draw.

Simple animations are provided:

  • when the battery is charging the main bar slowly breathes once in a while,
  • whenever the charger is disconnected several bubbles will be shown to escape the main bar to the right,
  • when the charger is connected a swift bright flash will travel through the main bar from left to right.

Installation

Local

Install the .plasmoid file in the releases of this repo.

Global (Arch-based)

A PKGBUILD is provided within this repo (in releases) to install this plasmoid globally on Arch based distros.

kde_batterybar's People

Contributors

lonelytransistor avatar

Stargazers

 avatar  avatar Olexiy avatar Luis Bocanegra avatar  avatar

Watchers

 avatar

Forkers

violettica

kde_batterybar's Issues

Looking at alignment options causes them to be null when config is next opened.

Steps to reproduce

  1. Place the widget anywhere on the desktop or in plasmoidviewer.
  2. Open the configuration for the widget.
  3. Observe Charge bar & Rate bar sections; alignments are available. One or more of these sections must be observed or the bug won't occur.
  4. Close config
  5. Re-open config, observe charge bar or rate bar section.

Expected behavior

Alignment options are available in both sections.
Battery Bar continues to function.

Actual behavior

Alignment option drop-downs for both sections are blank, clicking on them yields no results.
Battery Bar stops updating; changing data source does nothing.

Update battery info interval switches colors with confusing visual results

image

With two different colors to show the charging (power connected) and the discharging (power disconnected) status of the battery, that interval switches the two colors as if the battery was charging and discharging all the time. If the interval is 1 second the two colors are switched at 1 second interval. If I set a very long interval each of the 2 colors are shown alternatively for that long interval, and their significance for the battery status (connected or not) is lost.

I think the update of the battery status should have an adjustable setting but it should take place without any visual signal, unless the status of the battery has indeed changed (charging <>discharging). But now we have visual signals that a reading is made under the hood although what is read stays the same.

As posted in a different issue, the animations do not work properly. Now, even colors cannot be used to clearly see if my battery is charging or not as the colors are fluctuating anyway.

As things are, the only way to avoid seeing that colors (switching at long or short intervals) is to set exactly the same color and same opacity for "current bar charge" (meaning: color of the bar when discharging) and "current bar charge when charging" (by the way, these names should be changed!):

image

But that makes me lose any visual info on charging status (given I cannot trust the animations for the moment).

Changing bar position greatly increases its thickness

This doesn't happen with any change, but it happens for example, in this configuration, with the two very thin (2 pixel) parallel bars (rate is below):

image

if I change the position of the discharging rate bar (the one below) from bottom left to top left, so that the two are superposed, the rate bar changes its size too:

image

This can be fixed by changing the thickness from 2 to 3, saving, and again from 3 to 2 - and saving again.

Connecting or disconnecting resets rate bar thickness to full

Similar to the previously reported bug #13, but triggered by connecting or disconnecting the power cable.

(widget left of the system tray, both bars have 2-pixel thickness, the upper bar is the charge)

Charging it looks like so:

image

and discharging like so:

image

although the settings look like so:

image

(Like the other problem, it's fixed by changing the thickness from 2 to 3, saving, and again from 3 to 2 - and saving again.)

Create a nice icon

An icon is needed for the applet's logo and the placeholder when in edit mode.

The rate bar is too long?

The widget is situated on a top plasma panel, like so:

image

But although sometimes the charging rate bar fills all the space to the right, in other cases it goes far to the left.

image

I think that is because I have set the charging rate bar to be situated "bottom right", so that it extends to the left now. But is that going so much to the left beyond the widget position expected? I was under the impression that the bars only go to the right of the widget container, and never to the left of it, because if I put the widget at the extreme right, like so

image

then both bars are squeezed to the right, even if I set them both to the right

image

Is that normal?

Sometimes battery has zero capacity

Sometimes upower reports 0Wh of battery capacity making the widget divide by zero. A way to extrapolate missing data should be devised and an alternative data source should be provided to not rely on dbus calls.

No battery icon

In edit mode I see this:

image

but in normal view, only the long bar is visible, no icon.

image

Plasma 5.25.5, Kubuntu 22.10

No charging-related animations

  • when the battery is charging the main bar slowly breathes once in a while: I have set that very low to be able to test it works, I see nothing
  • whenever the charger is disconnected several bubbles will be shown to escape the main bar to the right: no bubbles
  • when the charger is connected a swift bright flash will travel through the main bar from left to right: that should be hard to miss, but I don't see it.

The panel is to the top:

image

Could it be because of my hardware? I'm on a macbook.

How to define the panel space the main (charge) bar fills at full battery level?

I prefer to use only the main bar, the one that shows the battery level, and made the slim one completely transparent. I think the main bar could be a very interesting way of seeing battery level at a glance, considering the proportion of the panel it fills.

But I don't really understand how to set the maximum width, by comparison to which the proportion of battery level is defined.

Looking closer into the settings, I see that the bar alignment options (top right, left etc) are very important. So, I will define a specific scenario.

First of all, I want the battery bar to be to the right of a top panel. But with the same settings, the bar changes depending on the position of the container.

These are the settings:

image

With the container/widget position like this:

image

The bar is squeezed to the right:

image

With a bar alignment to the left, at 90% battery, it still fills just a small fraction of the panel space between the container/icon and the right margin of the panel.

image

It is as if the "filled" part of the bar showed the empty percentage of battery.


Let's consider now another specific configuration: widget position is left of the upper panel, bar aligner to top left:

image

At 94% battery, the bar looks like this:

image

Changing alignment o the top right, it looks like so:

image

It is not clear what space the bar fills in order to represent the battery percentage.

Anyway, the position of the widget seem to change the logic of the bar.

At 100% I will see the full space it is supposed to fill. But how to define that space?


When the battery reached 100% the bar (with some different colors but same last settings as above) looks like so:

image

This seems to make sense. Now I can approximate the charge relative to something between the widget that shows battery percentage and the right margin. But any other position of the the battery-bar widget/container seems to make little sense.

Animations are not following settings.

I am mostly interested in visual information about the battery status (charging or discharging).
I would like to see a clear signal on the moment of connecting and disconnecting power. These seem to have a very long delay, therefore I have disabled breathing so that I see more clearly the rest.

But:

  • breathing continues even if disabled and even if power is disconnected
  • I see bubbles during charging

Main bar is full all the time

It should be like described:

main bar (green by default) - fills the screen based on the percentage of power left in the battery,

But the green bar has filled the screen completely, while the battery is below half:

image

and after a while as the battery drains the main bar stays full.

New alignment option for rate bar: From end of battery bar

Currently it works like this:

image

And when charging:

image

I actually have no idea: does this mean in 1 hour I will have this much battery left:

Option1

Or this much:

Option2

The latter seems much less intuitive to me. I think it is what is being used.

Anyway, if the bar only started from the inflection point and extended to how far it should go, I think this would be easier to understand. Like so:

Option3

(and similar for when consuming battery)

(Also I was the one who left the recent review. I think it is when settings are changed that it freezes and stops updating until I log out/in again. Is there a way to see logs from the widget?)

The widget icon shouldn't take space on the panel outside edit mode

The widget has a visible icon in edit mode, but the space that icon takes on panel when it is invisible (in normal mode, by contrast to edit mode), is still visible.

See in this image below how another widget (Transparent panel button) that has a similar button visible only in edit mode fills no space outside edit mode, while this widget keeps taking space on the panel:

image

image

In settings and github description only "discharge" is mentioned in relation to the rate bar

As said here, the rate bar shows not only the discharge, but also the charge rate per hour.

It shows the charging rate. I.e. what amount of battery will be charged within the hour.

That should be added in the description of the auxiliary bar, here: https://github.com/lonelytransistor/kde_batterybar#usage

Also, in rate bar settings, "discharge" is the only term used to discuss color and opacity. "Charge/discharge" should be used instead.

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.