You are not logged in.
Hi!
Is there a possibility that cbatticon hibernates my system on low battery (user-defined "low level") ?
As far as i see, it is not possible now. So i guess this can be a feature request!
EDIT: just added this to the source file and compiled again, seems to work:
if (!battery_low && percentage < 15) { //changed from default 20
battery_state = DISCHARGING;
battery_low = 1;
notify_battery_information (LOW_POWER, percentage, time_string);
}
if (battery_low && percentage < 5)
system("systemctl hibernate");
Is this so ugly? Or can it be implemented in cbatticon?
Thanks!
Last edited by nierro (2012-09-22 08:33:20)
Offline
hello...
cbatticon seem good but i don't know how can display icons....I have icons but I don't know where i put them. we must change the code cbatticon?
thank you....
Does this 'cbatticon --list-icon-types' mentions that icons are found ?
If not, it means your icon theme doesn't contains the required icons. What theme do you use ?
Offline
if (battery_low && percentage < 5) system("systemctl hibernate");
Is this so ugly? Or can it be implemented in cbatticon?
Thanks!
Yes, it is very ugly. It binds cbatticon to systemd.
Easiest solution is to make it a new optional parameter.
I'll look at it.
Offline
Yes i know. I was only looking for the fastest way to achieve that, and i came up with that
Waiting for an update then!
Offline
Hi all,
New feature has been added to execute any user defined command when critical battery level (5%) is reached.
List of available options is now:
Application Options:
-u, --update-interval Set update interval (in seconds)
-i, --icon-type Set icon type ('standard', 'notification' or 'symbolic')
-c, --command-critical-level Command to execute when critical battery level (5%) is reached
-t, --list-icon-types List available icon types
-b, --list-batteries List available batteries
--display=DISPLAY X display to use
Enjoy!
Offline
Thanks!:)
Offline
Hi,
I'm using this right now and it works fine. I'm just wondering whether it's possible to have the icon changing according to the battery state (little progress bar). I'm currently using AwOkenDark icons and awesome window manager.
Cheers,
Kubouch
EDIT: Sorry, it actually works. I had about 45% and it was showing almost full so I was confused. It seems that it changes when under 40%.
Last edited by Kubouch (2013-01-31 18:44:42)
Offline
Offline
Hi all,
New features have been added to specify low battery level and critical battery level.
List of available options is now:
Application Options:
-u, --update-interval Set update interval (in seconds)
-i, --icon-type Set icon type ('standard', 'notification' or 'symbolic')
-c, --command-critical-level Command to execute when critical battery level is reached
-l, --low-level Set low battery level (in percent)
-r, --critical-level Set critical battery level (in percent)
-t, --list-icon-types List available icon types
-b, --list-batteries List available batteries
Examples:
cbatticon
cbatticon -t
cbatticon -b
cbatticon -u 20 -i notification -c "systemctl poweroff" -l 15 -r 3
Default value for options:
update interval : 5 seconds
icon type : the first one that is available in this sequence:
standard, notification or symbolic
(check your setup with --list-icon-types)
command critical level : none
low level : 20 percent
critical level : 5 percent
battery id : the first one that is reported by udev
Enjoy!
Offline
Hi all,
New features have been added to specify low battery level and critical battery level.
List of available options is now:
...
When customizing low battery levels why not to enable customizing other battery levels (40%, 80%)? I'm just curious.
However I have another intricate query. Is there any command to invoke the popup message appearing when a cursor is hovering upon the icon? My intention is to keybind the command to have mouse-independent access to my current battery state. I use Awesome WM on my laptop and I'm trying to minimize cursor moving as much as possible.
Kubouch
Offline
When customizing low battery levels why not to enable customizing other battery levels (40%, 80%)? I'm just curious.
The low and critical levels (that can be manually set via options) are events that trigger a specific notifications. If you set the low level at e.g. 30% then the 'low level' notification will appear at 30% i.o. default of 20%. Other levels (40%, ..., 80%) don't trigger a specific notification.
Is there any command to invoke the popup message appearing when a cursor is hovering upon the icon? My intention is to keybind the command to have mouse-independent access to my current battery state.
Not sure it's possible to trigger the display of the tooltip from a keybind. I'll have a look at it.
Offline
Sorry for spamming here again but I need an insight again.
When I run cbatticon in terminal I get this error:
Gtk-WARNING **: Unable to locate theme engine in module_path: "mist"
Cbatticon runs normally, though. (Well, ran... Now it's broken for some reason as I posted here.)
When I install gtk-engines (Mist theme is included there) error message disappears. Why is cbatticon requiring Mist? I use Owl Light theme with AwOken icons so from my point of view there is no point of installing gtk-engines at all.
Offline
Why is cbatticon requiring Mist?
It doesn't. It's gtk that requires the theme and that complains when it doesn't find one.
Edit: regarding the battery not found, does cbatticon show something when you do this:
cbatticon --list-batteries
If yes, use that info, if not I can't help. I have no ThinkPad.
Last edited by valr (2013-02-08 15:26:24)
Offline
It's gtk that requires the theme and that complains when it doesn't find one.
Well, I think I'll leave it complaining. Thanks for info.
Edit: regarding the battery not found, does cbatticon show something when you do this:
cbatticon --list-batteries
Yes, it shows path to my BAT0 (/sys/devices/.../power_supply/BAT0). Not sure how to use this, though.
Last edited by Kubouch (2013-02-09 09:18:18)
Offline
Kubouch wrote:Is there any command to invoke the popup message appearing when a cursor is hovering upon the icon? My intention is to keybind the command to have mouse-independent access to my current battery state.
Not sure it's possible to trigger the display of the tooltip from a keybind. I'll have a look at it.
Ok, after having looked at it I've found no clean way (well, not found any way at all, in fact) to trigger the display of a tooltip via a keypress. It's not made for that and technically the main problem is that a GtkStatusIcon is not a GtkWidget but a GObject. This already restrict quite a lot what can be done. What could be done via a keypress is displaying a notification i.e. using a notification daemon, but I guess it's not what you want.
Offline
Offline
Hi all,
Here is a status update on cbatticon development:
Version 1.1 was posted few times ago.
It was mainly posted to add an option to (try to) determine status even when 'unknown' status is returned (some batteries do it when (dis)charging).
Some other small fixes.
Version 1.2 has just been posted.
Dependency on libudev has been removed.
A message is sent to system logger before spawning command when critical level is reached.
Tooltip and notification messages have been reworked.
The version option (-v) has been added.
Fixed bug triggering the switching from normal calculation to estimated calculation when not needed.
Lots of code cleaning/rework.
More to come,
Cheers
Offline
Hi all,
I've forgotten to keep this thread up-to-date.
Version 1.3.0 -> 1.3.2 were released long time ago with main changes:
* Added option to hide notification at runtime
* Fix compilation with libnotify version older than 0.7.0
Version 1.4.0 has just been released with main changes:
* Allow building with(out) libnotify support (default: build with libnotify)
* Allow building with gtk2 or gtk3 (default: build with gtk2)
* Renamed option --list-batteries into --list-power-supplies to show battery and AC
* Allow AC only tray icon when there is no battery
* Allow execution of command when left clicking on the tray icon
* Added debug option
cbatticon is now in the community repo.
Cheers
Offline
Hi,
Firstly, thanks for writing this software, I use it with FVWM and find it extremely useful.
Since the last update, the colour of the cbatticon symbolic icon has changed on my system from white to black. Is there a way to revert back to the old colour? Or is this due to some other change (like an icon theme change?
Thanks,
Rob
Offline
Since the last update, the colour of the cbatticon symbolic icon has changed on my system from white to black. Is there a way to revert back to the old colour? Or is this due to some other change (like an icon theme change?
Well, it could be a bug. Have you tried with the previous version (you can reinstall it from your pacman cache) to be sure it's not a change in your icon theme ?
If you indeed have a difference of behaviour between the old & new version of cbatticon, can you provide me the name of your icon theme and the command line you use to start cbatticon ?
When you say that the icon change from white to black, which icon is it: the one when your battery if full ? or any icon (discharging, ...) changed from white to black ?
Thanks
Offline
Hi,
The only icon theme setting I'm aware of is gtk-icon-theme-name="Tango" in my .gtkrc-2.0. Tango hasn't been updated in years. Having said that, these look a little bit like the Faenza status icons, but white instead of black, a happy accident, until now. The faenza icon theme package was last updated Wed 02 Jul 2014.
I've tried reverting from 1.4.0-1 => 1.3.2-2 (i686), but it exhibits the same behaviour. With 1.3.2-2 the icon is white (upper part of screenshot below), with 1.4.0-1 the icon is black (lower part of screenshot below).
The command I'm using is:
cbatticon -u 20 -i symbolic -c "systemctl poweroff" -l 35 -r 25
Thanks,
Rob
Offline
I've checked the code and in fact the one related to determination of the icon name has not been changed.
But there is something that also has changed with this version is that it has now been built with gtk3 and not with gtk2 anymore.
Can you check your gtk3 settings ?
Offline
Hi,
After some experimentation, changing icon sets, the icons themselves would change but the colour would remain as black. It is definitely a gtk3 thing - I rebuilt the 1.4.0 package but changed WITH_GTK3=1 to WITH_GTK3=0 and the symbolic icon is white again.
It's nothing major tbh, it works, and I have an angle to approach this from now. Perhaps my system tray (trayer) doesn't handle gtk3 icons very well. I'll investigate from that viewpoint.
Thanks for your help.
Rob
Offline
This doesn't appear to help, but this may be due to trayer being not fully aware of gtk3 settings. I'll try a few options, maybe try a different system tray. If I find a solution, I'll post it here.
Offline