Brightness now prints current brighness if no arguments given.
This commit is contained in:
parent
1ed8502169
commit
fdff328382
@ -3,8 +3,12 @@
|
|||||||
[ -z $IS_LAPTOP ] && exit
|
[ -z $IS_LAPTOP ] && exit
|
||||||
|
|
||||||
blpath=/sys/class/backlight/intel_backlight
|
blpath=/sys/class/backlight/intel_backlight
|
||||||
|
|
||||||
|
max=$(cat $blpath/max_brightness)
|
||||||
|
current=$(cat $blpath/brightness)
|
||||||
if [ -z $1 ]
|
if [ -z $1 ]
|
||||||
then
|
then
|
||||||
|
printf %.0f\\n $(echo "$current/$max * 100" | bc -l)
|
||||||
exit
|
exit
|
||||||
elif (( $1 < 10 ))
|
elif (( $1 < 10 ))
|
||||||
then
|
then
|
||||||
@ -16,7 +20,6 @@ else
|
|||||||
perc=$1
|
perc=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
max=$(cat $blpath/max_brightness)
|
|
||||||
brightness="$(($max * $perc / 100))"
|
brightness="$(($max * $perc / 100))"
|
||||||
echo $brightness > $blpath/brightness
|
echo $brightness > $blpath/brightness
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user