mirror of
https://github.com/kastdeur/dotfiles.git
synced 2024-11-16 00:23:31 +01:00
35 lines
516 B
Bash
Executable file
35 lines
516 B
Bash
Executable file
#!/bin/bash
|
|
disps=$(xrandr -q | grep " connected")
|
|
|
|
if [ "$1" = '-h' ];
|
|
then
|
|
echo $0 '[-h] [displaycode,[ brightness]]'
|
|
exit
|
|
fi
|
|
|
|
if [ ! -z $2 ];
|
|
then
|
|
disp=$1
|
|
bright=$2
|
|
elif [ $(echo $disps | wc | awk '{print $1}') = 1 ];
|
|
then
|
|
disp=$(echo $disps | awk '{print $1}')
|
|
else
|
|
echo "Available displays:"
|
|
echo $disps
|
|
echo "What display to use?"
|
|
read disp
|
|
fi
|
|
|
|
if [ -z $bright ];
|
|
then
|
|
if [ ! -z $1 ];
|
|
then
|
|
bright=$1
|
|
else
|
|
echo "Brightness[0-1]:"
|
|
read bright
|
|
fi
|
|
fi
|
|
|
|
xrandr --output $disp --brightness $bright
|