some clarification
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
subprogram="$(command -v "$0")"
|
||||
if ! nonzero "$subprogram" && ! test -e "$0"; then
|
||||
if ! str isvalue "$subprogram" && ! test -e "$0"; then
|
||||
printf "%s: can't find myself!\n" "$0"
|
||||
exit 70 # sysexits(3) EX_SOFTWARE
|
||||
else
|
||||
|
||||
@@ -22,7 +22,7 @@ emit "$(printf "Current level: %d%%" "$current_level")"
|
||||
|
||||
while true; do
|
||||
current_level=$(battery)
|
||||
if ! [ $current_level -eq $previous_level ]; then
|
||||
if ! streq $current_level $previous_level; then
|
||||
[ $current_level -lt $previous_level ] \
|
||||
&& emit "$(printf "Discharged: %d%% -> %d%%\n" $previous_level $current_level )" \
|
||||
|| emit "$(printf " Charged: %d%% -> %d%%\n" $previous_level $current_level )"
|
||||
|
||||
Reference in New Issue
Block a user