mirror of https://git.sr.ht/~skiqqy/bin
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
370 B
21 lines
370 B
#!/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
|
|
|