summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbl20
1 files changed, 10 insertions, 10 deletions
diff --git a/bl b/bl
index 4ebff00..44de5c7 100755
--- a/bl
+++ b/bl
@@ -161,12 +161,12 @@ get_raw_new() {
done
case "$op" in
- +) : $(( new = curr + val )) ;;
- -) : $(( new = curr - val )) ;;
+ "+") : $(( new = curr + val )) ;;
+ "-") : $(( new = curr - val )) ;;
"") : $(( new = val )) ;;
- =+) : $(( raw_new = raw_curr + val )) ;;
- =-) : $(( raw_new = raw_curr - val )) ;;
- =) : $(( raw_new = val )) ;;
+ "=+") : $(( raw_new = raw_curr + val )) ;;
+ "=-") : $(( raw_new = raw_curr - val )) ;;
+ "=") : $(( raw_new = val )) ;;
*)
printf "invalid operator '%s'\n" "$op" >&2
exit 2
@@ -256,14 +256,14 @@ main() {
op="${1:-}"
case "$op" in
"") printf "%d\n" "$curr" ;;
- +[0-9]*) set_brightness + "${op#+}" ;;
- -[0-9]*) set_brightness - "${op#-}" ;;
+ "+"[0-9]*) set_brightness + "${op#+}" ;;
+ "-"[0-9]*) set_brightness - "${op#-}" ;;
[0-9]*) set_brightness "" "$op" ;;
- =) printf "%d\n" "$raw_curr" ;;
+ "=") printf "%d\n" "$raw_curr" ;;
"="+[0-9]*) set_brightness "=+" "${op#=+}" ;;
- #+=[0-9]*) set_brightness "=+" "${op#+=}" ;;
+ #"+="[0-9]*) set_brightness "=+" "${op#+=}" ;;
"="-[0-9]*) set_brightness "=-" "${op#=-}" ;;
- #-=[0-9]*) set_brightness "=-" "${op#-=}" ;;
+ #"-="[0-9]*) set_brightness "=-" "${op#-=}" ;;
"="[0-9]*) set_brightness "=" "${op#=}" ;;
*)
printf "invalid operator: '%s'\n" "$op" >&2