[bin] Better fade levels, finer grained
This commit is contained in:
@ -1,13 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
max_brightness=$(cat /sys/class/backlight/intel_backlight/max_brightness)
|
max_brightness=$(cat /sys/class/backlight/intel_backlight/max_brightness)
|
||||||
brightness=$(cat /sys/class/backlight/intel_backlight/brightness)
|
brightness=$(cat /sys/class/backlight/intel_backlight/brightness)
|
||||||
step=$(( max_brightness / 8 ))
|
step=$((max_brightness / 12))
|
||||||
inc=2
|
inc=2
|
||||||
low_delta=$((brightness - step))
|
low_delta=$((brightness - step))
|
||||||
high_delta=$((brightness + step))
|
high_delta=$((brightness + step))
|
||||||
|
|
||||||
if { [ "$1" = "down" ] && [ $low_delta -ge $step ]; } || { [ "$1" = "up" ] && [ $high_delta -le "$max_brightness" ]; }
|
if { [ "$1" = "down" ] && [ $low_delta -ge $step ]; } || { [ "$1" = "up" ] && [ $high_delta -le "$max_brightness" ]; }; then
|
||||||
then
|
|
||||||
for i in $(seq $step); do
|
for i in $(seq $step); do
|
||||||
case $1 in
|
case $1 in
|
||||||
'up')
|
'up')
|
||||||
|
|||||||
Reference in New Issue
Block a user