Skip to content

Commit 56a7d53

Browse files
authored
Update helpers.sh
Add pull request tmux-plugins#89 - Fix battery percentage output when using upower ( tmux-plugins#89 )
1 parent 3ecf749 commit 56a7d53

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/helpers.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,14 @@ battery_status() {
6161
fi
6262
fi
6363
}
64+
65+
float2int() {
66+
local float="$1"
67+
if [[ $float =~ "," ]]; then
68+
echo ${float%,*}
69+
elif [[ $float =~ "." ]]; then
70+
echo ${float%.*}
71+
else
72+
echo ${float//%}
73+
fi
74+
}

0 commit comments

Comments
 (0)