Re: [BRLTTY] Low battery alert

2017-01-17 Thread Shérab
Dear Sebastian,

Many thanks for the script! It's interesting to know several persons
have thought about this problem.

And thanks, too, for the info about the ThinkPd, it's a very interesting
one, too!

Cheers,

Shérab.
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-17 Thread Sebastian Humenda
Hi Shérab

Shérab schrieb am 13.01.2017, 13:38 +0100:
>Has someone successfully set-up a low battery alert system that does not
>depend on a graphical desktop, please?
Yes, I do have written a script on my own. It's executed with cron, the crontab
looks like this:

* * * * * python3 /home/user/bin/akkuleer.py

The akkuleer.py (batter empty) is attached. It basically requires python3, aplay
and a file ~/.sounds/battery_low.wav.

Additional plus for this script is, that it can cope both with laptops with one
or two batteries (the newer Thinkpad have two).

HTH
Sebastian
-- 
Web: http://www.crustulus.de (English|Deutsch)  | Blog: 
http://www.crustulus.de/blog
FreeDict: Free multilingual dictionaries - http://www.freedict.org
Freies Latein-Deutsch-Wörterbuch: http://www.crustulus.de/freedict.de.html
#!/usr/bin/env python3
# vim:set expandtab sts=4 ts=4:

import subprocess, re, os, sys, time
from functools import reduce

proc=subprocess.Popen(['/usr/bin/acpi'], stdout=subprocess.PIPE)
data = proc.communicate()[0].decode(sys.getdefaultencoding())
batteries = []
for line in data.split('\n'):
if line == '':
continue
try:
matched = re.search(
'Battery \d+:\s+(Discharging|Charging|Unknown|Full), (\d+)%.*',
line)
matched = int(matched.groups()[1])
except (AttributeError, ValueError):
os.system('espeak -v de --stdout -s 250 "Konnte keine Batterieinformationen ermitteln" | aplay -q -')
raise
batteries.append(matched)

under_7_percent = all(i < 7 for i in batteries)
if under_7_percent:
for i in range(0, 5):
os.system('aplay -q ~/.sounds/battery_low.wav &> /dev/null')
time.sleep(2)



signature.asc
Description: PGP signature
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-17 Thread Shérab
Hi,

chry...@web.de (2017/01/15 17:21 +):
> Howdy
> 
> It could be found here:
> http://github.com/webczat/sbmonitor
> 
> Webczat told me sounds are not embeded but the service is in an working state.
> 
> It uses the following bindings:
> - libmm
> - gtkmm
> - gstreamermm
> 
Many thanks for all this information!

Will give it a try as soon as possible.
Perhaps it could even be packaged for Debian & co somehow.

Cheers,

Shérab.
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-15 Thread chrys87
Howdy

It could be found here:
http://github.com/webczat/sbmonitor

Webczat told me sounds are not embeded but the service is in an working state.

It uses the following bindings:
- libmm
- gtkmm
- gstreamermm

Cheers chrys 

Am Sa. Jan. 14 14:14:43 2017 GMT+0100 schrieb Shérab:
> Hi Chrys,
> 
> chry...@web.de (2017/01/14 12:48 +):
> > Howdy,
> > 
> > weechat from irc.netwirc.tk #a11y IRC wrote an service for doing that
> > with some features. Not sure about the current  state nor where the
> > code is located. But i can ask if you are intrested  in testing
> 
> Yes, please!
> 
> Thanks,
> 
> Shérab.
> ___
> This message was sent via the BRLTTY mailing list.
> To post a message, send an e-mail to: BRLTTY@brltty.com
> For general information, go to: http://brltty.com/mailman/listinfo/brltt

-- 
Gesendet von meinem Jolla
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-14 Thread Shérab
Hi Chrys,

chry...@web.de (2017/01/14 12:48 +):
> Howdy,
> 
> weechat from irc.netwirc.tk #a11y IRC wrote an service for doing that
> with some features. Not sure about the current  state nor where the
> code is located. But i can ask if you are intrested  in testing

Yes, please!

Thanks,

Shérab.
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-14 Thread chrys87
Howdy,

weechat from irc.netwirc.tk #a11y IRC wrote an service for doing that with some 
features. Not sure about the current  state nor where the code is located. But 
i can ask if you are intrested  in testing

Cheers chrys 

Am Sa. Jan. 14 13:00:48 2017 GMT+0100 schrieb MENGUAL Jean-Philippe:
> Hi,
> 
> Yes, I used cron. Every 1 minute it was run.
> 
> Regards,
> 
> 
> Le 14/01/2017 à 08:32, Shérab a écrit :
> > Hi Jean-Philippe,
> > 
> > Thanks. It can be done that way, indeed. How was your script started?
> > Was it at boot time by rc.local or something like that? And then was it
> > using a while loop to run the acpi command regularly? Or was it perhaps
> > run by cron?
> > 
> > I thought there may be some kind of system infrastructure that could be
> > used to make all this easier...
> > 
> > Cheers,
> > 
> > Shérab.
> > ___
> > This message was sent via the BRLTTY mailing list.
> > To post a message, send an e-mail to: BRLTTY@brltty.com
> > For general information, go to: http://brltty.com/mailman/listinfo/brltty
> > 
> 
> -- 
> 
> Jean-Philippe MENGUAL
> 
> HYPRA, progressons ensemble
> 
> Tél.: 01 84 73 06 61
> Mail: cont...@hypra.fr
> 
> Site Web: http://hypra.fr
> ___
> This message was sent via the BRLTTY mailing list.
> To post a message, send an e-mail to: BRLTTY@brltty.com
> For general information, go to: http://brltty.com/mailman/listinfo/brltt

-- 
Gesendet von meinem Jolla
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-14 Thread MENGUAL Jean-Philippe
Hi,

Yes, I used cron. Every 1 minute it was run.

Regards,


Le 14/01/2017 à 08:32, Shérab a écrit :
> Hi Jean-Philippe,
> 
> Thanks. It can be done that way, indeed. How was your script started?
> Was it at boot time by rc.local or something like that? And then was it
> using a while loop to run the acpi command regularly? Or was it perhaps
> run by cron?
> 
> I thought there may be some kind of system infrastructure that could be
> used to make all this easier...
> 
> Cheers,
> 
> Shérab.
> ___
> This message was sent via the BRLTTY mailing list.
> To post a message, send an e-mail to: BRLTTY@brltty.com
> For general information, go to: http://brltty.com/mailman/listinfo/brltty
> 

-- 

Jean-Philippe MENGUAL

HYPRA, progressons ensemble

Tél.: 01 84 73 06 61
Mail: cont...@hypra.fr

Site Web: http://hypra.fr
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-13 Thread Shérab
Hi Jean-Philippe,

Thanks. It can be done that way, indeed. How was your script started?
Was it at boot time by rc.local or something like that? And then was it
using a while loop to run the acpi command regularly? Or was it perhaps
run by cron?

I thought there may be some kind of system infrastructure that could be
used to make all this easier...

Cheers,

Shérab.
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Re: [BRLTTY] Low battery alert

2017-01-13 Thread MENGUAL Jean-Philippe
Hi,

I had done such script some years ago. It used acpi -b, and cut the
result with the cut command. Then, cut result was in a (ariable and if
variable had a number lower than 10, it played a sound.

Best regards,


Le 13/01/2017 à 13:38, Shérab a écrit :
> Dear all,
> 
> Has someone successfully set-up a low battery alert system that does not
> depend on a graphical desktop, please?
> 
> If so, which tools do you use to achieve this?
> 
> Many thanks,
> 
> Shérab.
> ___
> This message was sent via the BRLTTY mailing list.
> To post a message, send an e-mail to: BRLTTY@brltty.com
> For general information, go to: http://brltty.com/mailman/listinfo/brltty
> 

-- 

Jean-Philippe MENGUAL

HYPRA, progressons ensemble

Tél.: 01 84 73 06 61
Mail: cont...@hypra.fr

Site Web: http://hypra.fr
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

[BRLTTY] Low battery alert

2017-01-13 Thread Shérab
Dear all,

Has someone successfully set-up a low battery alert system that does not
depend on a graphical desktop, please?

If so, which tools do you use to achieve this?

Many thanks,

Shérab.
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty