~skiqqy/bin

bin/brightness -rwxr-xr-x 370 bytes
c3280652Stephen Cochrane Added sandbox script 6 days 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