brightness-notify: allow setting brightness value
This commit is contained in:
parent
89ac120211
commit
9fd4749a81
1 changed files with 4 additions and 1 deletions
|
@ -8,7 +8,10 @@ round() {
|
||||||
|
|
||||||
oldbrightness="$(cat /sys/class/backlight/*/brightness)"
|
oldbrightness="$(cat /sys/class/backlight/*/brightness)"
|
||||||
oldpercent="$(round "$oldbrightness * (100/255)")"
|
oldpercent="$(round "$oldbrightness * (100/255)")"
|
||||||
newpercent="$(round "$oldpercent + $1")"
|
case $1 in
|
||||||
|
-* | +*) newpercent="$(round "$oldpercent + $1")" ;;
|
||||||
|
*) newpercent=$1 ;;
|
||||||
|
esac
|
||||||
newbrightness="$(round "$newpercent * (255/100)")"
|
newbrightness="$(round "$newpercent * (255/100)")"
|
||||||
|
|
||||||
if [ "$newpercent" -gt "100" ]; then
|
if [ "$newpercent" -gt "100" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue