Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ alternatively, if you have no battery and would like a nerdfont icon to indicate
set -g @dracula-no-battery-label " "
```

if you only want to hide the battery widget on a desktop pc, set the following:

```bash
# default is false
set -g @dracula-battery-hide-on-desktop true
```

### compact-alt - [up](#table-of-contents)

This widget allows the user to switch to an alternate list of widgets when the terminal becomes narrow.
Expand Down
7 changes: 7 additions & 0 deletions scripts/battery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ main()

bat_perc=$(battery_percent)

hide_on_desktop="$(get_tmux_option "@dracula-battery-hide-on-desktop" "false")"
# If no battery percent, don't show anything
if [ -z "$bat_perc" ] && [ "$hide_on_desktop" = "true" ]; then
echo ""
return
fi

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
Expand Down