summaryrefslogtreecommitdiff
path: root/completions/xrandr
diff options
context:
space:
mode:
Diffstat (limited to 'completions/xrandr')
-rw-r--r--completions/xrandr8
1 files changed, 5 insertions, 3 deletions
diff --git a/completions/xrandr b/completions/xrandr
index 757b6589..643b11f5 100644
--- a/completions/xrandr
+++ b/completions/xrandr
@@ -19,9 +19,11 @@ _xrandr()
break
fi
done
- local modes=$( xrandr | sed -e "1,/$output/ d" \
- -e "/connected/,$ d" | awk '{print $1}' )
- COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) )
+ if [[ $output ]]; then
+ local modes=$( xrandr | sed -e "1,/$output/ d" \
+ -e "/connected/,$ d" | awk '{print $1}' )
+ COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) )
+ fi
return
;;
-o|--orientation)