Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Event notification (non cron/polling) when low battery

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
shogun1234
Posts: 156
Joined: 2006-07-13 08:04
Has thanked: 3 times

Event notification (non cron/polling) when low battery

#1 Post by shogun1234 »

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

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

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

#2 Post by bw123 »

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.
resigned by AI ChatGPT

shogun1234
Posts: 156
Joined: 2006-07-13 08:04
Has thanked: 3 times

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

#3 Post by shogun1234 »

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.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

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

#4 Post by debiman »

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.

Post Reply