2019-05-15 08:51:58 +00:00
|
|
|
#!/bin/bash
|
2019-07-05 04:49:29 +00:00
|
|
|
# this part is only used for startup scripts mainly
|
|
|
|
if [ ! -z "$1" ]
|
|
|
|
then
|
2019-07-05 19:53:08 +00:00
|
|
|
screens="`xrandr | grep ' connected' | awk '{print $1}'`"
|
2019-09-02 02:02:04 +00:00
|
|
|
percentage=`echo "scale=2;" "$1/100" | bc -l`
|
2019-07-05 04:49:29 +00:00
|
|
|
for s in $screens; do
|
2019-09-02 02:02:04 +00:00
|
|
|
xrandr --output "$s" --brightness "0$percentage"
|
|
|
|
echo xrandr --output "$s" --brightness "0$percentage"
|
2019-07-05 04:49:29 +00:00
|
|
|
done
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-07-05 19:53:08 +00:00
|
|
|
# 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
|
2019-07-04 21:39:04 +00:00
|
|
|
|
2019-07-05 19:53:08 +00:00
|
|
|
percentage=`echo "scale=2;" "$level/100" | bc -l`
|
|
|
|
if [ -z "$percentage" ]; then exit; fi
|
|
|
|
|
|
|
|
screens="`xrandr | grep ' connected' | awk '{print $1}'`"
|
2019-07-04 21:39:04 +00:00
|
|
|
for scr in $screens;do
|
|
|
|
xrandr --output "$scr" --brightness $percentage
|
|
|
|
done
|