[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#455225: /usr/bin/xrandr: please consider possibility to disable hardware detection



Marc Haber wrote:
> when invoked, xrandr does detection of hardware capabilities and
> connected monitors. This takes a few seconds to complete.
>
> I have a script, xrandrauto, which invokes xrandr multiple times to
> create the screen layout that I want to have. However, this script
> takes like 30 seconds since xrandr repeats the detection process over
> and over.
>
> Please consider adding an option to disable the hardware detection and
> to use whatever was detected the last time.
>   

Right, it would be nice, especially when calling xrandr blanks the screen
during a second or so.

Of course, patches would be wellcome :)

> OUTPUTLIST=""
> for output in $(xrandr | sed -n '/[^[:space:]]\+ connected/{s/\([^[:space:]]\+\).*/\1/;p;}'); do
>   xrandr --output $output --auto
>   OUTPUTLIST="$OUTPUTLIST $output"
> done
> for output in $(xrandr | sed -n '/[^[:space:]]\+ disconnected/{s/\([^[:space:]]\+\).*/\1/;p;}'); do
>   xrandr --output $output --auto
> done
>
> if [ "$OUTPUTLIST" = " VGA-0 LVDS" ]; then
>   xrandr --output VGA-0 --left-of LVDS
> elif [ "$OUTPUTLIST" = " LVDS" ]; then
>   xrandr --output LVDS --pos 0x0
> fi
>   

You should be able to call xrandr only twice here. One to get the output
and save it (and apply sed multiple times to compute OUTPUTLIST), and
one to pass --auto for all outputs and set their position.

Brice





Reply to: