You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Upgrade color and icons to have higher granularity
This is a large overhaul of the colors and icons in the plugin to enable
higher granularity. All efforts have been made to have sane defaults.
Additionally, a new 'status' has been added that is a catch-all
'unknown' in case a battery tool acts up or fails to report something
meaningful.
Added 8 new format strings:
* #{battery_color_bg} - will set the background color of the status bar
based on the battery charge level and status
* #{battery_color_fg} - will set the foreground color of the status bar
based on the battery charge level and status
* #{battery_color_charge_bg} - will set the background color of the
status bar based solely on the battery charge level
* #{battery_color_charge_fg} - will set the foreground color of the
status bar based solely on the battery charge level
* #{battery_color_status_bg} - will set the background color of the
status bar based solely on the battery status
* #{battery_color_status_fg} - will set the foreground color of the
status bar based solely on the battery status
* #{battery_icon_charge} - will display a battery charge icon
* #{battery_icon_status} - will display a battery status icon
Removed 2 format strings:
* #{battery_status_bg}
* #{battery_status_fg}
Added 39 new options:
* @batt_color_charge_primary_tier8 - primary color to show at [95%-100%]
battery charge
* @batt_color_charge_primary_tier7 - primary color to show at [80%-95%)
battery charge
* @batt_color_charge_primary_tier6 - primary color to show at [65%-90%)
battery charge
* @batt_color_charge_primary_tier5 - primary color to show at [50%-65%)
battery charge
* @batt_color_charge_primary_tier4 - primary color to show at [35%-50%)
battery charge
* @batt_color_charge_primary_tier3 - primary color to show at [20%-35%)
battery charge
* @batt_color_charge_primary_tier2 - primary color to show at [5%-20%)
battery charge
* @batt_color_charge_primary_tier1 - primary color to show at [0%-5%)
battery charge
* @batt_color_charge_secondary_tier8 - secondary color to show at [95%-
100%] battery charge
* @batt_color_charge_secondary_tier7 - secondary color to show at [80%-
95%) battery charge
* @batt_color_charge_secondary_tier6 - secondary color to show at [65%-
90%) battery charge
* @batt_color_charge_secondary_tier5 - secondary color to show at [50%-
65%) battery charge
* @batt_color_charge_secondary_tier4 - secondary color to show at [35%-
50%) battery charge
* @batt_color_charge_secondary_tier3 - secondary color to show at [20%-
35%) battery charge
* @batt_color_charge_secondary_tier2 - secondary color to show at [5%-
20%) battery charge
* @batt_color_charge_secondary_tier1 - secondary color to show at [0%-
5%) battery charge
* @batt_color_status_primary_charged - primary color to show for a
battery in 'fully-charged' status
* @batt_color_status_primary_charging - primary color to show for a
battery in 'charging' status
* @batt_color_status_primary_discharging - primary color to show for a
battery in 'discharging' status
* @batt_color_status_primary_attached - primary color to show for a
battery in 'attached' status
* @batt_color_status_primary_unknown - primary color to show for a
battery in an unknown status
* @batt_color_status_secondary_charged - secondary color to show for a
battery in 'fully-charged' status
* @batt_color_status_secondary_charging - secondary color to show for a
battery in 'charging' status
* @batt_color_status_secondary_discharging - secondary color to show for
a battery in 'discharging' status
* @batt_color_status_secondary_attached - secondary color to show for a
battery in 'attached' status
* @batt_color_status_secondary_unknown - secondary color to show for a
battery in an unknown status
* @batt_icon_charge_tier8 - icon to show at [95%-100%] battery charge
* @batt_icon_charge_tier7 - icon to show at [80%-95%) battery charge
* @batt_icon_charge_tier6 - icon to show at [65%-90%) battery charge
* @batt_icon_charge_tier5 - icon to show at [50%-65%) battery charge
* @batt_icon_charge_tier4 - icon to show at [35%-50%) battery charge
* @batt_icon_charge_tier3 - icon to show at [20%-35%) battery charge
* @batt_icon_charge_tier2 - icon to show at [5%-20%) battery charge
* @batt_icon_charge_tier1 - icon to show at [0%-5%) battery charge
* @batt_icon_status_charged - icon to show for a battery in 'fully-
charged' status
* @batt_icon_status_charging - icon to show for a battery in 'charging'
status
* @batt_icon_status_discharging - icon to show for a battery in
'discharging' status
* @batt_icon_status_attached - icon to show for a battery in 'attached'
status
* @batt_icon_status_unknown - icon to show for a battery in an unknown
status
Removed 12 options:
* @batt_charged_icon
* @batt_charging_icon
* @batt_attached_icon
* @batt_full_charge_icon
* @batt_high_charge_icon
* @batt_medium_charge_icon
* @batt_low_charge_icon
* @batt_color_full_charge
* @batt_color_high_charge
* @batt_color_medium_charge
* @batt_color_low_charge
* @batt_color_charging
Format string notes:
* #{battery_color_bg} and #{battery_color_fg} replace
#{battery_status_bg} and #{battery_status_fg}, respectively and
continue to act the same way
* #{battery_color_charge_bg/fg} changes colors based ONLY on the battery
charge level
* #{battery_color_status_bg/fg} changes colors based ONLY on the battery
status
* #{battery_icon_charge} displays ONLY an icon for the charge level
* #{battery_icon_status} displays ONLY an icon for the charge status
* #{battery_icon} continues to display both
Option notes:
* @batt_color_..._primary options are what will be displayed in the main
bg or fg you choose - e.g. if you use #{battery_color_bg}, the primary
color will be the background
* Likewise, the corresponding @batt_color_..._secondary option will be
the foreground in the example above
* Fixed #{battery_graph} format string
Previously, the #{battery_graph} format string wouldn't show an actual
graph. This has been fixed. The graph is also 5 characters wide now,
regardless of battery charge level.
* Clarified some language in README.md
* Changed a word because words are hard
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# Changelog
2
2
3
3
### master
4
+
- Fixed `#{battery_graph}` to actually display graph (@rux616)
5
+
- High-granularity icons and colors added. (@rux616)
4
6
- Changed preferred order of utility applications to be `pmset` -> `acpi` -> `upower` -> `termux-battery-status` due to CPU usage issues with `upower` (2019-03-05) (@rux616)
@@ -9,112 +9,227 @@ In order to read the battery status, this plugin depends on having one of the fo
9
9
- acpi
10
10
- upower
11
11
- termux-battery-status
12
+
- apm
12
13
13
14
In a normal situation, one of the above should be installed on your system by default and thus it should not be necessary to specifically install one of them. That being said, the `acpi` utility is currently recommended for use over `upower` where possible due to ongoing CPU usage issues.
14
15
15
16
### Installation with [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm) (recommended)
16
17
17
18
Add plugin to the list of TPM plugins in `.tmux.conf`:
18
19
19
-
set -g @plugin 'tmux-plugins/tmux-battery'
20
+
```tmux
21
+
set -g @plugin 'tmux-plugins/tmux-battery'
22
+
```
20
23
21
-
Hit `prefix + I` to fetch the plugin and source it.
24
+
Hit `<prefix> + I` to fetch the plugin and source it.
22
25
23
26
If format strings are added to `status-right`, they should now be visible.
-`#{battery_color_bg}` - will set the background color of the status bar based on the battery charge level and status
61
+
-`#{battery_color_fg}` - will set the foreground color of the status bar based on the battery charge level and status
62
+
-`#{battery_color_charge_bg}` - will set the background color of the status bar based solely on the battery charge level
63
+
-`#{battery_color_charge_fg}` - will set the foreground color of the status bar based solely on the battery charge level
64
+
-`#{battery_color_status_bg}` - will set the background color of the status bar based solely on the battery status
65
+
-`#{battery_color_status_fg}` - will set the foreground color of the status bar based solely on the battery status
66
+
-`#{battery_graph}` - will show battery percentage as a bar graph: ▁▂▄▆█
67
+
-`#{battery_icon}` - will display a battery status/charge icon
68
+
-`#{battery_icon_charge}` - will display a battery charge icon
69
+
-`#{battery_icon_status}` - will display a battery status icon
70
+
-`#{battery_percentage}` - will show battery percentage
71
+
-`#{battery_remain}` - will show remaining time of battery charge\*
72
+
73
+
\* These format strings can be further customized via options as described below.
74
+
75
+
#### Options
76
+
77
+
`#{battery_remain}`
78
+
79
+
-`@batt_remain_short`: 'true' / 'false' - This will shorten the time remaining (when charging or discharging) to `~H:MM`.
80
+
81
+
### Defaults
82
+
83
+
#### Options
84
+
85
+
-`@batt_remain_short`: 'false'
86
+
87
+
#### Icons/Colors
88
+
89
+
By default, the following colors and icons are used. (The exact colors displayed depends on your terminal / X11 config.)
90
+
91
+
Please be aware that the 'level of charge' as noted below (e.g. `[80%-95%)`) uses interval notation. If you are unfamiliar with it, <ahref="https://en.wikipedia.org/wiki/Bracket_(mathematics)#Intervals">check it out here</a>.
92
+
93
+
Also, a note about the `@batt_color_...` options: `@batt_color_..._primary` options are what will be displayed in the main `bg` or `fg` format strings you choose - e.g. if you use `#{battery_color_bg}`, the `@batt_color_..._primary` color you choose will be the background. Likewise, the corresponding `@batt_color_..._secondary` color will be the foreground.
All efforts have been made to make sane defaults, but if you wish to change any of them, add the option to `.tmux.conf`. For example:
150
+
151
+
```tmux
152
+
set -g @batt_icon_charge_tier8 '🌕'
153
+
set -g @batt_icon_charge_tier7 '🌖'
154
+
set -g @batt_icon_charge_tier6 '🌖'
155
+
set -g @batt_icon_charge_tier5 '🌗'
156
+
set -g @batt_icon_charge_tier4 '🌗'
157
+
set -g @batt_icon_charge_tier3 '🌘'
158
+
set -g @batt_icon_charge_tier2 '🌘'
159
+
set -g @batt_icon_charge_tier1 '🌑'
160
+
set -g @batt_icon_status_charged '🔋'
161
+
set -g @batt_icon_status_charging '⚡'
162
+
set -g @batt_icon_status_discharging '👎'
163
+
set -g @batt_color_status_primary_charged '#3daee9'
164
+
set -g @batt_color_status_primary_charging '#3daee9'
165
+
```
166
+
167
+
Don't forget to reload the tmux environment after you do this by either hitting `<prefix> + I` if tmux battery is installed via the tmux plugin manager, or by typing `tmux source-file ~/.tmux.conf` in the terminal if tmux battery is manually installed.
168
+
169
+
*Warning*: The battery icon change most likely will not be instant. When you un-plug the power cord, it will take some time (15 - 60 seconds) for the icon to change. This depends on the `status-interval` tmux option. Setting it to 15 seconds should be good enough.
These are all examples of the default plugin color and icon schemes paired with the default tmux color scheme using the following `status-right` and `status-right-length` settings in `.tmux.conf`
*Warning*: The battery icon change most likely will not be instant. When you un-plug the power cord, it will take some time (15 - 60 seconds) for the icon to change. This depends on the `status-interval` tmux option. Setting it to 15 seconds should be good enough.
0 commit comments