Fix brightness calculation
b62263bb1c3c2f9c0a9e2d13c1510293c7c625fd
1 parent
cfd38359
bin/xmobar-brightness
+2 -3
| 1 | 1 | #!/bin/sh |
|
| 2 | 2 | ||
| 3 | 3 | max=$(cat ~/settings/max-brightness) |
|
| 4 | 4 | actual=$(cat ~/settings/actual-brightness) |
|
| 5 | - | ratio=$(($max / $actual)) |
|
| 6 | - | bars=$(($ratio * 5)) |
|
| 5 | + | ratio=$(($actual * 100 / $max)) |
|
| 7 | 6 | ||
| 8 | - | printf "☀ $(($ratio * 100))%%" |
|
| 7 | + | printf "☀ $(($ratio))%%" |
|
| 9 | 8 | ||
| 10 | 9 |