forked from stagnation/i3-battery-warning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
i3-battery-warning | ||
================== | ||
# i3-battery-warning | ||
|
||
This is a simple battery warning script. It uses i3's nagbar to display warnings. Let this script run as a cronjob. | ||
|
||
This is a simple battery warning script. It uses i3's nagbar to display warnings. | ||
Open your crontab: | ||
|
||
Let this script run as a cronjob. | ||
```Shell | ||
crontab -e | ||
``` | ||
|
||
Open your crontab. | ||
Add the following line to check battery status every minute: | ||
|
||
$ crontab -e | ||
``` | ||
*/1 * * * * /PATH/TO/YOUR/SCRIPT/i3-batwarn | ||
``` | ||
|
||
Add the following line to check battery status every minute | ||
If the need to trouble shoot arises one could pipe the cron job output to a file like: | ||
|
||
*/1 * * * * /PATH/TO/YOUR/SCRIPT/i3batwarn.sh | ||
``` | ||
*/1 * * * * /PATH/TO/YOUR/SCRIPT/i3-batwarn > /tmp/batterywarn.log | ||
``` | ||
|
||
If the need to trouble shoot arises one could pipe the cron job output to a file like | ||
If the script only works when invoked from terminal and not as a crobjob: | ||
|
||
*/1 * * * * /PATH/TO/YOUR/SCRIPT/i3batwarn.sh > /tmp/batterywarn.log | ||
``` | ||
*/1 * * * * DISPLAY=:0 /PATH/TO/YOUR/SCRIPT/i3-batwarn | ||
``` | ||
|
||
If the script only works when invoked from terminal and not as a cronjob it might help to specify | ||
|
||
DISPLAY=:0 | ||
|
||
in the cron tab (before calling this script). | ||
|
||
screenshot | ||
========== | ||
## screenshot | ||
|
||
 | ||
|
||
fork changes | ||
============ | ||
## fork changes | ||
|
||
Added a pidfile where the pid of each (one max) nagbar is saved | ||
and a check to kill the nagbar if the battery is above the limit. | ||
This usually works but sometimes the nagbar has to be closed manually. | ||
* Added a warning level in addition to existing threshold | ||
* Check more often for the charger when de nagbar is active | ||
* Major refactoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.