mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit e1cf947697e3cd31cbefd5473fb0fdee4c759d16
parent ac111df503e7ef6f4eb4c6bad05152cab3deb6de
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Tue, 27 Feb 2018 10:35:45 +0100

Merge branch 'master' of a3nm.net:git/mybin

Diffstat:
xbl_adj | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/xbl_adj b/xbl_adj @@ -0,0 +1,18 @@ +#!/bin/bash +# adjust backlight by an increment percentage + +DIR="/sys/class/backlight/intel_backlight/" +MAX=$(cat $DIR/max_brightness) +CUR=$(cat $DIR/brightness) +ADJ=$1 +NEW=$(($CUR+$ADJ*$MAX/100)) +if [ $NEW -gt $MAX ] +then + NEW=$MAX +fi +if [ $NEW -lt 0 ] +then + NEW=0 +fi +echo $NEW | tee $DIR/brightness > /dev/null +