Added script to control screen brightness.
This commit is contained in:
parent
856aa61e83
commit
1add6c3d32
22
.config/wm_scripts/brightness.sh
Executable file
22
.config/wm_scripts/brightness.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
[ -z $IS_LAPTOP ] && exit
|
||||||
|
|
||||||
|
blpath=/sys/class/backlight/intel_backlight
|
||||||
|
if [ -z $1 ]
|
||||||
|
then
|
||||||
|
exit
|
||||||
|
elif (( $1 < 10 ))
|
||||||
|
then
|
||||||
|
perc=10
|
||||||
|
elif (( $1 > 100 ))
|
||||||
|
then
|
||||||
|
perc=100
|
||||||
|
else
|
||||||
|
perc=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
max=$(cat $blpath/max_brightness)
|
||||||
|
brightness="$(($max * $perc / 100))"
|
||||||
|
echo $brightness > $blpath/brightness
|
||||||
|
|
Loading…
Reference in New Issue
Block a user