Do not run xrandr when no screen connected

parent f6bb5062
......@@ -56,6 +56,11 @@ fi
screens=$(xrandr | grep " connected" | cut -f 1 -d ' ' \
| sed -e 's/ /\n/g' | grep -v $MAIN_SCREEN)
if [ "$(echo -e "$screens\n$MAIN_SCREEN" | wc -l)" -eq 0 ]
then
exit
fi
# Auto detect best resolution
for m in $(xrandr | awk -v pattern="^$MAIN_SCREEN" '/^.* connected/{IN=0} $0 ~ pattern {IN=1} /^ /{if(IN==1){print $1}}')
do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment