X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=sidebyside;f=bin%2Fw530_backlight.sh;h=5b24fa7265de68ef3f5c578572cd16372d7b3c3b;hb=5304303207a36a4533f8837e22b5bf70b652ff0f;hp=e9a0c6bd5e274c464938d039956e18e570706695;hpb=80f78202b5102feff4c08216c44819397867924e;p=config
diff --git a/bin/w530_backlight.sh b/bin/w530_backlight.sh
index e9a0c6b..5b24fa7 100755
--- a/bin/w530_backlight.sh
+++ b/bin/w530_backlight.sh
@@ -10,8 +10,8 @@ fi
backlight_dir=/sys/class/backlight/intel_backlight
max_brightness=$(cat "${backlight_dir}"/max_brightness)
target="${backlight_dir}"/brightness
-fract=$(expr "${max_brightness}" / 100)
if [ "${1}" = "+" -o "${1}" = "-" ]; then
+ fract=$(expr "${max_brightness}" / 20)
cur_brightness=$(cat "${backlight_dir}"/brightness)
brightness=$(expr "${cur_brightness}" "${1}" "${fract}")
if [ "${brightness}" -gt "${max_brightness}" ]; then
@@ -26,6 +26,7 @@ percentage=${1}
if [ "${percentage}" = '100' ]; then
sudo sh -c 'echo '"${max_brightness}"' > '"${target}"
else
+ fract=$(expr "${max_brightness}" / 100)
brightness=$(expr "${percentage}" \* "${fract}")
sudo sh -c 'echo '"${brightness}"' > '"${target}"
fi