Skip to content

Commit 74e07c7

Browse files
Merge pull request #292 from fvincenzo/master
Add icon for AC mode
2 parents 5b0f4b5 + 1d9476e commit 74e07c7

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
3333
- When prefix is enabled, a smiley face turns from green to yellow
3434
- When charging, 'AC' is displayed
3535
- Alternatively show battery level and whether its charging next to percentage by setting:
36-
`set -g @dracula-battery-label false`
37-
`set -g @dracula-show-battery-status true`
36+
```
37+
set -g @dracula-battery-label false
38+
set -g @dracula-no-battery-label false
39+
set -g @dracula-show-battery-status true
40+
```
3841
- If forecast information is available, a β˜€, ☁, β˜‚, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature
3942
- Info if the Panes are synchronized
4043
- Spotify playback (needs the tool spotify-tui installed). max-len can be configured.

β€Žscripts/battery.shβ€Ž

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,15 @@ battery_status()
151151
main()
152152
{
153153
bat_label=$(get_tmux_option "@dracula-battery-label" "β™₯")
154-
if [ "$bat_label" ]; then
154+
if [ "$bat_label" == false ]; then
155155
bat_label=""
156156
fi
157157

158+
no_bat_label=$(get_tmux_option "@dracula-no-battery-label" "AC")
159+
if [ "$no_bat_label" == false ]; then
160+
no_bat_label=""
161+
fi
162+
158163
show_bat_label=$(get_tmux_option "@dracula-show-battery-status" false)
159164
if $show_bat_label; then
160165
bat_stat=$(battery_status)
@@ -167,7 +172,7 @@ main()
167172
if [ -z "$bat_stat" ]; then # Test if status is empty or not
168173
echo "$bat_label $bat_perc"
169174
elif [ -z "$bat_perc" ]; then # In case it is a desktop with no battery percent, only AC power
170-
echo ""
175+
echo "$no_bat_label"
171176
else
172177
echo "$bat_label$bat_stat $bat_perc"
173178
fi

0 commit comments

Comments
Β (0)