Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add battery checker #30

Open
fossfreedom opened this issue Jul 25, 2015 · 5 comments
Open

add battery checker #30

fossfreedom opened this issue Jul 25, 2015 · 5 comments

Comments

@fossfreedom
Copy link
Owner

fossfreedom commented Jul 25, 2015

would be more than useful to have two battery level sensors

One that monitors if the battery reaches below a given percentage before using notify-send to warn

One that monitors if the battery reaches above a given percentage before using notify-send to warn

above has a good example of how to use upower to get the value


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ghost
Copy link

ghost commented Jul 28, 2015

@fossfreedom I have wrote a bash script but it requires acpi to be installed

@fossfreedom
Copy link
Owner Author

sounds interesting - any chance you can copy and paste the contents of the bash script here?

@ghost
Copy link

ghost commented Jul 29, 2015

@fossfreedom this is the code

#!/bin/bash
#Battery level
var=$(acpi -V| awk -F',' 'NR==1, /Battery 0:/ {print $2}'); 
# Temperature
#var=$(acpi -V| awk -F',' '/Thermal 0: ok, / {print $2}'); 
echo $var

For notifiying we have to simply use a conditional statement like if and use zenity message code or notify-send

@fossfreedom
Copy link
Owner Author

looks like from this that the battery values can be obtained directly from /sys/ without any need for installing extra packages:

@ghost
Copy link

ghost commented Feb 22, 2016

@fossfreedom Cool man, are you gonna add this function in your new release or we users have to add it ourselves. I have no python skills and have no idea how to use this information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant