Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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: 0 additions & 7 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,6 @@ 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
13 changes: 3 additions & 10 deletions scripts/battery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,10 @@ main()

bat_perc=$(battery_percent)

hide_on_desktop=$(get_tmux_option "@dracula-battery-hide-on-desktop" false)
# If no battery percent and the feature flag is enabled, hide the widget completely
if $hide_on_desktop && [ -z "$bat_perc" ]; 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
if [ -z "$bat_perc" ]; then # In case it is a desktop with no battery percent, only AC power
echo "$no_bat_label"
elif [ -z "$bat_stat" ]; then # Test if status is empty or not
echo "$bat_label $bat_perc"
else
echo "$bat_label$bat_stat $bat_perc"
fi
Expand Down