quick_action_bright_down 479 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. STEP_BRIGHTNESS=10
  3. NOTIF_DURATION=2
  4. # Get current value
  5. current_brightness=$(brightness_get)
  6. # Compute new brightness value
  7. new_brightness=0
  8. if [ ${current_brightness} -gt ${STEP_BRIGHTNESS} ]; then
  9. let new_brightness=${current_brightness}-${STEP_BRIGHTNESS}
  10. fi
  11. # Change brightness
  12. if [ ${new_brightness} -ne ${current_brightness} ]; then
  13. brightness_set ${new_brightness}
  14. fi
  15. # Notif
  16. notif_set ${NOTIF_DURATION} " BRIGHTNESS: ${new_brightness}%%"
  17. exit 0