Commit Graph

36 Commits

Author SHA1 Message Date
John D Pell
029e53a433 plugin/battery: fix handling of multiple batteries with upower 2022-03-03 23:45:40 -08:00
John D Pell
cade0a1e7a plugin/battery: split upower to two variables 2022-02-03 10:45:27 -08:00
Nariyasu Heseri
c794f4f0e7 plugin/battery: use --max-count of grep instead of head 2022-01-29 15:50:36 +09:00
Nariyasu Heseri
b87f3067b5 plugin/battery: bug fix
When `upower --enumerate | grep -i BAT` returns multiple lines of results (which are file paths),
the added quotation (from commit 3cb5f3f7e6) concatenates them all to provide an invalid path.
Thus to make the plugin work as before the commit,
take only the first line of the results.
2022-01-29 03:30:35 +09:00
John D Pell
3cb5f3f7e6 plugin/battery: shellcheck 2022-01-25 23:54:24 -08:00
simowdas
8f09914e63 Update battery.plugin.bash
Add -i option to grep BAT in upower to ignore case distinctions.
2019-04-11 10:57:04 +02:00
Nils Winkler
31990490fa Added test for the "no" energy tool case 2017-11-02 06:46:01 +01:00
Nils Winkler
fef8e9ed09 Fixed ioreg test case 2017-11-02 06:46:01 +01:00
Nils Winkler
629b8522e5 Ensuring that output is always two digits at least
Show "04" instead of just "4".
2017-11-02 06:46:01 +01:00
Nils Winkler
86a87a33b5 Refactored command output handling 2017-11-02 06:46:01 +01:00
Nils Winkler
a573b63da2 Simplified acpi 2017-11-02 06:46:01 +01:00
Nils Winkler
7602b1da32 Added tests for WMIC 2017-11-02 06:46:01 +01:00
Nils Winkler
601202e816 Simplified ioreg, added tests for no status 2017-11-02 06:46:01 +01:00
Nils Winkler
6b97283cbf Consolidated cases for pmset and ioreg 2017-11-02 06:46:01 +01:00
Nils Winkler
486c9e1382 Consolidated cases for acpi 2017-11-02 06:46:01 +01:00
Nils Winkler
b7b8a0afe0 Completed tests for upower command 2017-11-02 06:46:01 +01:00
Nils Winkler
d0b3205de0 Added an additional test case and a fix for using the pmset command
The other commands still need to be mocked and tested/fixed, too.
2017-11-02 06:46:01 +01:00
Nils Winkler
145ec5dfaa Copied command_exists function to the helpers lib so that there is no hidden dependency on the base plugin
The original command_exists function will stay in the base plugin, but will no longer be used by other plugins or themes.
2017-09-17 21:05:59 +02:00
Luis Felipe Sánchez
a3e714e175 Update battery.plugin.bash
Added **pmset** command that improves the process of detecting the battery and its percentage
2017-07-12 18:59:47 -05:00
Luis Felipe Sánchez
222385c040 Update battery.plugin.bash
Fixed UPOWER command check when checking battery status
2017-07-02 17:41:06 -05:00
shine
00bb17c3e5 Fix upower output bug with 100% 2017-06-11 15:27:45 +05:30
shine
98f13c7b6a Support upower for battery plugin 2017-06-11 14:33:22 +05:30
Luis Felipe Sánchez
176cf00f6c Update battery.plugin.bash
- Add WIndows Bash checker.
- Clean and organize the code.
2017-05-25 23:27:12 -05:00
Luis Felipe Sánchez
13f30838ba Improvements in the theme for a better appearance, I hope you like, added the option of downloading the battery for a better style.
Improvements in the theme for a better appearance, I hope you like,
added the option of downloading the battery for a better style.
2017-04-28 13:55:38 -05:00
Nils Winkler
e5d50f0d97 Simplified logic for both Linux and OS X
Avoiding the if statements, using exit code of `grep -q` instead.

Reverted the change that adds a space after the AC char. Opting for a
default value, allowing to override from one's profile.
2016-04-14 08:16:32 +02:00
Nils Winkler
a9c5670c2c Added AC indicator support on OS X
Not sure about the logic for returning 1/0 from the function, though -
will have to clarify.
2016-04-12 09:56:03 +02:00
Travis Swicegood
c5de52aef3 Changing to output 100% for full battery on OS X.
This commit ensures that `battery_percentage` has the same output
on both Linux and OS X. Thanks @jfmcarreira for finding this!
2016-03-25 10:13:16 -05:00
Joao Carreira
320e864f59 Fix battery plugin
Clean cases and remove spaces and % symbol in one awk command
2016-03-24 16:34:32 +00:00
Nils Winkler
2d13b3294a Fixed conversion when the battery percentage is in the single digits.
The previous version was printing an error when the battery percentage
was in the single digits, e.g. "7.04%". The code cuts returns the first
two digits, which in the case of "7.04%" are "7.". Any code that tries
to use that, e.g. the powerline-multiline theme will fail with an error.

This change corrects that by zero padding single digits, i.e. "07.04%"
instead of "7.04%".
2015-05-05 11:30:25 +02:00
Eduardo Bellido Bellido
42aa39b235 New funcion "ac_adapter_connected" in battery plugin 2015-02-04 23:05:03 +01:00
Erich Smith
08e439c4f0 update plugin management 2012-05-13 22:13:54 -04:00
Erich Smith
55e77deac1 standardize plugins, update metadata
add about-plugin metadata
chmod -x plugins
cleanup filenames to standardize on x.plugin.bash format
only plugin files intended to be executable from the command line should
contain a shebang line, and should be a+x.
2012-05-13 22:13:54 -04:00
Erich Smith
3f8fe6157c update plugin documentation 2012-05-09 09:27:10 -04:00
Eitan Adler
3fc60b5358 Fix bogus bash binary location 2012-04-17 00:24:58 -04:00
JFSIII
1b7c9419bf Convert themes and plugins to use the update colors. Themes are no longer burdened with escaping the unprintable characters 2011-06-17 19:45:21 -04:00
Travis Swicegood
ffa45b0391 Create the concept of enabled plugins
This allows users to disable a plugin without completely removing it.
Instead, they simply remove the `plugins/enabled/*.bash` file for the
plugin they want to disable.  This continues the concept of "everything
on" while providing greater flexibility to future users.

It might be a good idea to allow turning these off by default in the
future and allowing not only the `plugins/enabled/*.bash` files but also
an array of `<plugin_name>` values that would search for
`plugins/available/<plugin_name>.plugin.bash` to enable them.  That
method would make it easier for people custom tune their plugins from
within their `.bash_profile` script.
2011-05-02 23:12:50 -05:00