Event notification (non cron/polling) when low battery

Everything about X, Gnome, KDE, ... and everything running on it

Event notification (non cron/polling) when low battery

Postby shogun1234 » 2017-04-08 21:11

My laptop is Dell Precision 5520. And I want to find a non DE dependent way (I don't use Gnome, KDE, etc.) to alert when battery is running low e.g. 10%.

However, most of the solutions so far I found are either cron or polling to check periodically. It's not bad but I prefer event style notification. For instance, when battery is running low, an event is triggered and my script or whatever can then use notifiy-send to alert on screen or do hibernate. Unfortunately searching online using keyword like battery + event + linux + notication doesn't find related information. So my questions:

- if it's hardware dependent (such as battery event notifies OS proactively), what keyword should I use to search on, for instance, Dell's website?

- if there has such event I can exploit, where (e.x. conf files) or how should I look up or configure in os (/etc dir)?

Thanks
shogun1234
 
Posts: 80
Joined: 2006-07-13 08:04

Re: Event notification (non cron/polling) when low battery

Postby bw123 » 2017-04-09 15:43

What about package 'laptop-mode-tools' have you looked into something like that?

https://packages.debian.org/jessie/laptop-mode-tools

I guess you could log all the acpi events also and see what messages get sent.
User avatar
bw123
 
Posts: 2479
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Event notification (non cron/polling) when low battery

Postby shogun1234 » 2017-04-10 22:10

Never heard of that. Will check if I can get any event notification with that, and update it here. Thanks!

bw123 wrote:What about package 'laptop-mode-tools' have you looked into something like that?

https://packages.debian.org/jessie/laptop-mode-tools

I guess you could log all the acpi events also and see what messages get sent.
shogun1234
 
Posts: 80
Joined: 2006-07-13 08:04

Re: Event notification (non cron/polling) when low battery

Postby debiman » 2017-04-12 19:25

shogun1234 wrote:when battery is running low, an event is triggered and my script or whatever can then use notifiy-send to alert on screen or do hibernate.

so what is wrong with that?
just do it (tm).

failing that, some DE's utilities work well even without the whole DE installed, e.g. xfce4-power-manager.
User avatar
debiman
 
Posts: 1633
Joined: 2013-03-12 07:18


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable