You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
686 B

  1. #!/bin/bash
  2. set -e
  3. # Define the backlight device
  4. BACKLIGHT_DEVICE="/sys/class/backlight/intel_backlight"
  5. INCREMENT=5000 # Adjust this to the value you want to increase
  6. # Get the current and max brightness
  7. current_brightness=$(cat "$BACKLIGHT_DEVICE/brightness")
  8. max_brightness=$(cat "$BACKLIGHT_DEVICE/max_brightness")
  9. # Calculate new brightness value
  10. new_brightness=$((current_brightness + INCREMENT))
  11. # Ensure it doesn't exceed the maximum brightness
  12. if [ "$new_brightness" -gt "$max_brightness" ]; then
  13. new_brightness=$max_brightness
  14. fi
  15. # Set the new brightness
  16. echo "$new_brightness" > "$BACKLIGHT_DEVICE/brightness"
  17. notify-send "Brightness increased to $new_brightness"