refractor plus additional click and long string functions
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user