Skip to content

Commit

Permalink
Merge pull request #292 from fvincenzo/master
Browse files Browse the repository at this point in the history
Add icon for AC mode
  • Loading branch information
ethancedwards8 authored Oct 7, 2024
2 parents 5b0f4b5 + 1d9476e commit 74e07c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
- When prefix is enabled, a smiley face turns from green to yellow
- When charging, 'AC' is displayed
- Alternatively show battery level and whether its charging next to percentage by setting:
`set -g @dracula-battery-label false`
`set -g @dracula-show-battery-status true`
```
set -g @dracula-battery-label false
set -g @dracula-no-battery-label false
set -g @dracula-show-battery-status true
```
- If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature
- Info if the Panes are synchronized
- Spotify playback (needs the tool spotify-tui installed). max-len can be configured.
Expand Down
9 changes: 7 additions & 2 deletions scripts/battery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ battery_status()
main()
{
bat_label=$(get_tmux_option "@dracula-battery-label" "")
if [ "$bat_label" ]; then
if [ "$bat_label" == false ]; then
bat_label=""
fi

no_bat_label=$(get_tmux_option "@dracula-no-battery-label" "AC")
if [ "$no_bat_label" == false ]; then
no_bat_label=""
fi

show_bat_label=$(get_tmux_option "@dracula-show-battery-status" false)
if $show_bat_label; then
bat_stat=$(battery_status)
Expand All @@ -167,7 +172,7 @@ main()
if [ -z "$bat_stat" ]; then # Test if status is empty or not
echo "$bat_label $bat_perc"
elif [ -z "$bat_perc" ]; then # In case it is a desktop with no battery percent, only AC power
echo ""
echo "$no_bat_label"
else
echo "$bat_label$bat_stat $bat_perc"
fi
Expand Down

0 comments on commit 74e07c7

Please sign in to comment.