From 6be0f32a8e3e2563bfd838e5bdef68562d27c3e9 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 22 Aug 2021 20:21:03 -0400 Subject: bin/bright: Increase bc scale --- diff --git a/bin/bright b/bin/bright index dd8f2df..791e0df 100755 --- a/bin/bright +++ b/bin/bright @@ -12,7 +12,7 @@ get_b() b=$(brightnessctl --class=backlight get) || return 1 printf '%.0f\n' $(printf \ - 'scale = 4;'$(: \ + 'scale = 20;'$(: \ )'((%d - 1) * sqrt((%d - %d) * (%d - (2 * %d - %d)))) / '$(: \ )'(%d - %d)\n' \ ${STEPS} ${MIN} ${b} ${b} ${max} ${MIN} ${max} ${MIN} | bc) @@ -26,7 +26,7 @@ set_b() shift 1 brightnessctl --class=backlight set $(printf '%.0f\n' $(printf \ - 'scale = 4;'$(: \ + 'scale = 20;'$(: \ )'%d + (1 - sqrt(1 - (%d / (%d - 1))^2)) * (%d - %d)\n' \ ${MIN} ${b} ${STEPS} ${max} ${MIN} | bc)) || return 1 -- cgit v0.9.1