~skiqqy/bin

ref: 3c0ea9d1382310297caced4fd4804dbbbb47ce66 bin/brightness -rwxr-xr-x 370 bytes
3c0ea9d1Stephen Cochrane Added touch on start 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
usage () {
	echo "brightness <value>"
	echo "value must be in the change [0.5, 1]"
}

if [[ $# -eq 0 ]]
then
	value=1
else
	value=$1
fi

if [[ $(echo "$value < 0.5" | bc -l) -eq 1 || $(echo "$value > 1" | bc -l) -eq 1 ]]
then
	usage
	exit 1
fi

screen=$(xrandr -q | grep 'connected' | head -n 1 | cut -d " " -f 1)
xrandr --output $screen --brightness $value