Skip to content

Commit

Permalink
Update helpers.sh
Browse files Browse the repository at this point in the history
Add pull request tmux-plugins#89 
- Fix battery percentage output when using upower 
( tmux-plugins#89 )
  • Loading branch information
slange-dev authored Dec 17, 2024
1 parent 3ecf749 commit 56a7d53
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,14 @@ battery_status() {
fi
fi
}

float2int() {
local float="$1"
if [[ $float =~ "," ]]; then
echo ${float%,*}
elif [[ $float =~ "." ]]; then
echo ${float%.*}
else
echo ${float//%}
fi
}

0 comments on commit 56a7d53

Please sign in to comment.