mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-03-26 04:57:45 +01:00
statusbar: battery script changed
This commit is contained in:
parent
7cddd5c649
commit
8fbffbc7c6
@ -11,8 +11,10 @@ total=$(echo $acpi | sed 's/.*:\ //')
|
||||
|
||||
status="$(echo $total | cut -d',' -f1)"
|
||||
capacity="$(echo $total | cut -d',' -f2 | sed 's/%//')"
|
||||
capacity=$(echo "$capacity" | sed -e 's/$//')
|
||||
capacity=$(printf %3s $capacity | tr ' ' ' ')
|
||||
|
||||
if [ "$status" = "Discharging" ] && [ $capacity -le 15 ] ; then
|
||||
notify-send -u critical "Battery" "Below 15%"
|
||||
fi
|
||||
|
||||
case "$status" in
|
||||
"Discharging")
|
||||
@ -27,4 +29,7 @@ case "$status" in
|
||||
icon="^b#282828^^c#dfdfdf^ ⚡ ^d^";;
|
||||
esac
|
||||
|
||||
capacity=$(echo "$capacity" | sed -e 's/$//')
|
||||
capacity=$(printf %3s $capacity | tr ' ' ' ')
|
||||
|
||||
echo "$icon $capacity%"
|
||||
|
Loading…
x
Reference in New Issue
Block a user