Skip to content

Instantly share code, notes, and snippets.

@dardourimohamed
Created May 24, 2018 22:19
Show Gist options
  • Save dardourimohamed/f8f3a755ba9d85286da9e18a213780e2 to your computer and use it in GitHub Desktop.
Save dardourimohamed/f8f3a755ba9d85286da9e18a213780e2 to your computer and use it in GitHub Desktop.
Backlight brightness incerement/decrement. usage : increment : "brightness intel_backlight 10" or decrement : "brightness intel_backlight -10"
#!/bin/bash
DEVICE=$1
VALUE=$2
FILE="/sys/class/backlight/$DEVICE/brightness"
CURR_VALUE=$( cat "$FILE" )
VALUE="$(( $CURR_VALUE + $VALUE ))"
CMD="echo $VALUE > $FILE"
sudo su -c "$CMD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment