|
|
|
@ -4,6 +4,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
iDIR="$HOME/.config/swaync/icons" |
|
|
|
iDIR="$HOME/.config/swaync/icons" |
|
|
|
notification_timeout=1000 |
|
|
|
notification_timeout=1000 |
|
|
|
|
|
|
|
step=10 # INCREASE/DECREASE BY THIS VALUE |
|
|
|
|
|
|
|
|
|
|
|
# Get brightness |
|
|
|
# Get brightness |
|
|
|
get_backlight() { |
|
|
|
get_backlight() { |
|
|
|
@ -37,10 +38,10 @@ change_backlight() { |
|
|
|
current_brightness=$(get_backlight) |
|
|
|
current_brightness=$(get_backlight) |
|
|
|
|
|
|
|
|
|
|
|
# Calculate new brightness |
|
|
|
# Calculate new brightness |
|
|
|
if [[ "$1" == "+5%" ]]; then |
|
|
|
if [[ "$1" == "+${step}%" ]]; then |
|
|
|
new_brightness=$((current_brightness + 5)) |
|
|
|
new_brightness=$((current_brightness + step)) |
|
|
|
elif [[ "$1" == "5%-" ]]; then |
|
|
|
elif [[ "$1" == "${step}%-" ]]; then |
|
|
|
new_brightness=$((current_brightness - 5)) |
|
|
|
new_brightness=$((current_brightness - step)) |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Ensure new brightness is within valid range |
|
|
|
# Ensure new brightness is within valid range |
|
|
|
@ -62,10 +63,10 @@ case "$1" in |
|
|
|
get_backlight |
|
|
|
get_backlight |
|
|
|
;; |
|
|
|
;; |
|
|
|
"--inc") |
|
|
|
"--inc") |
|
|
|
change_backlight "+5%" |
|
|
|
change_backlight "+${step}%" |
|
|
|
;; |
|
|
|
;; |
|
|
|
"--dec") |
|
|
|
"--dec") |
|
|
|
change_backlight "5%-" |
|
|
|
change_backlight "${step}%-" |
|
|
|
;; |
|
|
|
;; |
|
|
|
*) |
|
|
|
*) |
|
|
|
get_backlight |
|
|
|
get_backlight |
|
|
|
|