refractor plus additional click and long string functions

This commit is contained in:
koksnuss
2018-05-31 00:29:13 +02:00
parent 4b9d064b32
commit 492abcf744
6 changed files with 52 additions and 24 deletions

View File

@ -9,7 +9,7 @@ if [[ "$BLOCK_INSTANCE" == "" ]]; then
[[ -f "${BAT}uevent" ]] && BATS+="$BAT/uevent "
done
else
[[ -f "$DIR/BAT$BLOCK_INSTANCE/uevent" ]] && BATS="$DIR/BAT$BLOCK_INSTANCE/uevent"
[[ -f "$DIR/BAT$BLOCK_INSTANCE/uevent" ]] && BATS="$DIR/BAT$BLOCK_INSTANCE/uevent"
fi
if [[ "$BATS" == "" ]]; then
@ -23,7 +23,7 @@ cat $BATS | gawk -F '=' -v LONG="$LONG" '
efull = 0
enow = 0
status = ""
}
}
/POWER_SUPPLY_STATUS=/ {
if (status == "") {
if ($2 == "Discharging") {
@ -45,7 +45,7 @@ cat $BATS | gawk -F '=' -v LONG="$LONG" '
printf("%s%d%\n", status, charge)
} else {
if (charge < 100 / 9) {
printf("\n")
printf("%s▁\n", status)
} else if (charge < 100 / 9 * 2 ) {
printf("%s▁\n", status)
} else if (charge < 100 / 9 * 3 ) {
@ -62,7 +62,7 @@ cat $BATS | gawk -F '=' -v LONG="$LONG" '
printf("%s▇\n", status)
} else {
printf("%s█\n", status)
}
}
}
printf("%s%d\n", status, charge)
if (charge > 25) {