Dependancyfree
Now without brightnessctl dependancy
This commit is contained in:
parent
e8daf94cda
commit
1a919d6299
2 changed files with 25 additions and 10 deletions
|
@ -146,17 +146,29 @@ do
|
|||
NewLight=$(( $DiffCount ))
|
||||
|
||||
|
||||
|
||||
CurrentBrightness=$(cat $BLightPath)
|
||||
FakeLight=$(( $NewLight + $CurrentBrightness))
|
||||
|
||||
if [[ $FakeLight -gt $MaxScreenBrightness ]]
|
||||
then
|
||||
NewLight=$MaxScreenBrightness
|
||||
echo "ERROR"
|
||||
else
|
||||
echo $FakeLight > $BLightPath
|
||||
fi
|
||||
|
||||
# Format values apropriatly for brightnessctl
|
||||
if [[ $NewLight -lt 0 ]]
|
||||
then
|
||||
NewLight=$( echo "$NewLight" | awk -F "-" {'print$2'})
|
||||
NewLight=$(echo $NewLight-)
|
||||
else
|
||||
NewLight=$(echo +$NewLight)
|
||||
fi
|
||||
|
||||
#if [[ $NewLight -lt 0 ]]
|
||||
#then
|
||||
#NewLight=$( echo "$NewLight" | awk -F "-" {'print$2'})
|
||||
#NewLight=$(echo $NewLight-)
|
||||
#else
|
||||
#NewLight=$(echo +$NewLight)
|
||||
#fi
|
||||
|
||||
# Adjust brightness relativly
|
||||
brightnessctl -q s $NewLight
|
||||
#brightnessctl -q s $NewLight
|
||||
# Sleep for the screen Hz time so he effect is visible
|
||||
sleep $AnimationDelay
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue