Skip to content

Commit

Permalink
Add util to grok with display backlight brightness
Browse files Browse the repository at this point in the history
  • Loading branch information
Olli Pikarinen committed Jan 19, 2018
1 parent d4c310d commit 68562d5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/brightness
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

: ${1?"Usage: $0 argument"}

brightness=`cat /sys/class/backlight/intel_backlight/brightness`
max_brightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
new_brightness=`printf %.0f $(echo "$brightness*$1" | bc -l)`

if [ $new_brightness -gt $max_brightness ]
then
new_brightness=$max_brightness
fi

echo $new_brightness > /sys/class/backlight/intel_backlight/brightness

0 comments on commit 68562d5

Please sign in to comment.