24 lines
653 B
Bash
Executable File
24 lines
653 B
Bash
Executable File
#!/bin/bash
|
|
# this part is only used for startup scripts mainly
|
|
if [ ! -z "$1" ]
|
|
then
|
|
screens="`xrandr | grep ' connected' | awk '{print $1}'`"
|
|
for s in $screens; do
|
|
xrandr --output "$s" --brightness "0.7"
|
|
echo xrandr --output "$s" --brightness "0.7"
|
|
done
|
|
exit 0
|
|
fi
|
|
|
|
# Changes brightness through dmenu (because i like my eyes)
|
|
level=`seq 1 100 | dmenu -i -p 'Brightnesss from 1-100'`
|
|
if [ -z "$level" ]; then exit; fi
|
|
|
|
percentage=`echo "scale=2;" "$level/100" | bc -l`
|
|
if [ -z "$percentage" ]; then exit; fi
|
|
|
|
screens="`xrandr | grep ' connected' | awk '{print $1}'`"
|
|
for scr in $screens;do
|
|
xrandr --output "$scr" --brightness $percentage
|
|
done
|