diff options
author | Urbain Vaes <urbain@vaes.uk> | 2020-10-04 19:13:49 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2020-10-04 19:13:49 +0100 |
commit | 3a3321af173a73b158c606f0e2c3c3e0dece2cb9 (patch) | |
tree | 00075dc12714c8b128e2327542526ac0676820fc /i3/.config/i3blocks | |
parent | ac7ba6d8aa7eb6ef384f10b7798bd01308beb970 (diff) | |
parent | 2c5e2b7a6667fd4e726bba3e50f9ccf6ce13bab3 (diff) |
Merge branch 'master' of https://github.com/urbainvaes/dotfiles
Diffstat (limited to 'i3/.config/i3blocks')
-rwxr-xr-x | i3/.config/i3blocks/bin/battery | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/i3/.config/i3blocks/bin/battery b/i3/.config/i3blocks/bin/battery index 378ee3f..0286809 100755 --- a/i3/.config/i3blocks/bin/battery +++ b/i3/.config/i3blocks/bin/battery @@ -5,7 +5,6 @@ if [ ! -d /sys/class/power_supply/BAT0 ]; then exit fi -current_now=$(cat /sys/class/power_supply/BAT0/current_now) charge_now=$(cat /sys/class/power_supply/BAT0/charge_now) charge_full=$(cat /sys/class/power_supply/BAT0/charge_full) bat_status=$(cat /sys/class/power_supply/BAT0/status) @@ -16,7 +15,7 @@ if [ "$bat_status" = "Full" ]; then fi if [ "$bat_status" = "Discharging" ]; then - tot_minutes_remaining=$(( charge_now*60/current_now )) + # tot_minutes_remaining=$(( charge_now*60/current_now )) if [[ $charge_percent -lt 20 ]]; then icon="" @@ -36,14 +35,16 @@ if [ "$bat_status" = "Discharging" ]; then fi elif [ "$bat_status" = "Charging" ]; then - tot_minutes_remaining=$(( (charge_full-charge_now)*60/current_now )) + # current_now=$(cat /sys/class/power_supply/BAT0/current_now) + # tot_minutes_remaining=$(( (charge_full-charge_now)*60/current_now )) icon= color="lightblue" fi -time_remaining=$(printf "%02d:%02d" \ - $(( tot_minutes_remaining/60 )) \ - $(( tot_minutes_remaining - (tot_minutes_remaining/60)*60 ))) +# time_remaining=$(printf "%02d:%02d" \ +# $(( tot_minutes_remaining/60 )) \ +# $(( tot_minutes_remaining - (tot_minutes_remaining/60)*60 ))) -echo "<span color='$color'>$icon</span> $charge_percent% ($time_remaining)" +# echo "<span color='$color'>$icon</span> $charge_percent% ($time_remaining)" +echo "<span color='$color'>$icon</span> $charge_percent%" |