Anachron / i3blocks

Additional/custom blocks which fit my needs
GNU General Public License v3.0
585 stars 106 forks source link

Minor fixes in brightness and weather scripts #33

Closed maximtrp closed 4 years ago

maximtrp commented 7 years ago

Brightness

There is a bug in brightness calculation in kernel mode.

echo "scale=0;${curBrightness} / ${maxBrightness} * 100" | bc -l

Above line will output just 0. Try:

echo "scale=0;150 / 255 * 100" | bc -l

"100" multiplier should be placed in the beginning as in the fixed code.

Weather When offline, script outputs plain "℃" without any temperature. I suggest checking if ${WEATHER_INFO} var is empty and exiting with 1 if it is (see code). Also, I added some colors. Check out yourself if you like it.

vKnmnn commented 4 years ago

i have merged a fix for the brightness bug from another PR, could you please remove commit 7a9314c from this PR?