summaryrefslogtreecommitdiff
path: root/bin/dell-monitor-brightness
blob: 98d5972919e9d831073ee47297918873d6b9059d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

if [ -z $1 ]; then
	echo "usage: $(basename $0) <brightness:0-100>"
	exit 1
fi

if (( $1 > 100 )) || (( $1 < 0 )); then
	echo "usage: $(basename $0) <brightness:0-100>"
	exit 1
fi

exec &>/dev/null

ddccontrol -r 0x10 -w $1 dev:/dev/i2c-8 

if [ $? -ne 0 ]; then
	echo "Error setting monitor brightness"
	exit 1
fi

exit 0