Merge branch 'master' of github.com:sheldonmlee/dotfiles

This commit is contained in:
Sheldon Lee 2021-11-26 23:52:43 +08:00
commit db9c183bdd

View File

@ -3,8 +3,12 @@
[ -z $IS_LAPTOP ] && exit
blpath=/sys/class/backlight/intel_backlight
max=$(cat $blpath/max_brightness)
current=$(cat $blpath/brightness)
if [ -z $1 ]
then
printf %.0f\\n $(echo "$current/$max * 100" | bc -l)
exit
elif (( $1 < 10 ))
then
@ -16,7 +20,6 @@ else
perc=$1
fi
max=$(cat $blpath/max_brightness)
brightness="$(($max * $perc / 100))"
echo $brightness > $blpath/brightness