I create script file name it lightdmxrandr.sh. here is file content:

xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync
xrandr --addmode LDVS-0 1024x768_60.00
xrandr --output DisplayPort-0 --off --output LVDS-0 --mode 1024x768_60.00 --pos 0x0 --rotate normal --output HDMI-0 --off
unity --replace

and in terminal write: bash home/kakao/lightdmxrandr.sh the I got following error

kakao@kakao-dro:~$ bash /home/kakao/lightdmxrandr.sh
X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  16 (RRCreateMode)
  Serial number of failed request:  29
  Current serial number in output stream:  29
xrandr: cannot find output "LDVS-0"
xrandr: cannot find mode 1024x768_60.00
unity-panel-service stop/waiting
unity-panel-service start/running, process 2960
compiz (core) - Info: Loading plugin: core
compiz (core) - Info: Starting plugin: core
compiz (core) - Info: Loading plugin: ccp
compiz (core) - Info: Starting plugin: ccp

First you must use xrandr to make sure that the new mode can fit within the maximum framebuffer size:

xrandr | grep maximum

Later you must use gtf to create a mode line:

gtf 1024 768 60.00

Below you can add new mode using xrandr:

xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -Hsync +Vsync

Now you can add this newly added mode to the desired output (VGA/LVDS)

xrandr --addmode LDVS-0 1024x768_60.00

And now you must choose the new mode

xrandr --output LDVS-0 --mode 1024x768_60.00

Once you have verified that everything works fine, you can just create the script to make de changes persistent.

| improve this answer | |

The output name is not correct:

xrandr: cannot find output "LDVS-0"

You can find the right output name with:

xrandr -q | grep " connected"

In my case:

eDP-1 connected primary 1864x1050+0+0 (normal left inverted right x axis y axis) 346mm x 194mm

I.e. I have to use eDP-1 as the output name.

| improve this answer | |

BadName may occur, if the name is already defined.

I also ran into this problem with badname yesterday and wrote a little bash-script that thinks for me ;-)

It creates modelines on the fly, if needed, chooses the output automatically, if possible and therefore might solve your problems directly.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.