mirror of
https://github.com/kastdeur/dotfiles.git
synced 2024-12-22 09:13:33 +01:00
Updated brightness script
This commit is contained in:
parent
12caa84687
commit
ba2d3bd44f
1 changed files with 15 additions and 4 deletions
|
@ -1,18 +1,29 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
disps=$(xrandr -q | grep " connected")
|
||||||
|
|
||||||
if [ ! -z $2 ];
|
if [ ! -z $2 ];
|
||||||
then
|
then
|
||||||
disp=$1
|
disp=$1
|
||||||
bright=$2
|
bright=$2
|
||||||
|
elif [ $(echo $disps | wc | awk '{print $1}') = 1 ];
|
||||||
|
then
|
||||||
|
disp=$(echo $disps | awk '{print $1}')
|
||||||
else
|
else
|
||||||
echo "Available displays:"
|
echo "Available displays:"
|
||||||
xrandr -q | grep " connected"
|
echo $disps
|
||||||
|
|
||||||
echo "What display to use?"
|
echo "What display to use?"
|
||||||
read disp
|
read disp
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z $bright ];
|
||||||
|
then
|
||||||
|
if [ ! -z $1 ];
|
||||||
|
then
|
||||||
|
bright=$1
|
||||||
|
else
|
||||||
echo "Brightness[0-1]:"
|
echo "Brightness[0-1]:"
|
||||||
read bright
|
read bright
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
xrandr --output $disp --brightness $bright
|
xrandr --output $disp --brightness $bright
|
||||||
|
|
Loading…
Reference in a new issue