65

I was successfully using xrandr to extend my desktop in my work place with this little "script".

#!/bin/sh

xrandr --newmode 1920x1080  220.64  1920 2056 2264 2608  1080 1081 1084 1128  -HSync +Vsync
xrandr --addmode VGA 1920x1080
xrandr --output VGA --mode 1920x1080

Everything was going well till one day that magically stop working. When I try to use it. I just get this message.

X Error of failed request: BadName (named color or font does not exist)

The laptop display resizes in a strange way, but nothing happens with the extended monitor.

I've restored gnome desktop default config. I changed the font config, I tried with other layouts and monitors, but always occur the same.

Mohit Jain
  • 30,259
  • 8
  • 73
  • 100
Jlbelmonte
  • 1,246
  • 1
  • 11
  • 14
  • 4
    have you solved this? I'm having a similar issue. – Thomas G Henry LLC Jun 10 '09 at 13:26
  • Not yet. I cannot understand what is going wrong. I wrote a crappy script to change default fonts, different Xorg server configs and xrandr modes , and always failed. Sorry. – Jlbelmonte Jun 11 '09 at 10:43
  • It's quite late but the thing is that my VGA output was absolutely burned :) – Jlbelmonte Feb 16 '11 at 10:57
  • 1
    Would be good if this was moved to askubuntu because I spent ages looking there before I found this! – m-smith Sep 15 '12 at 17:11
  • I spend 2 hour to solve similar problem and problem was in vga cable. Replace vga cable I can change resolution to 1920x1080 without using xrandr or xorg it's very strange. – burtsevyg Jul 09 '16 at 22:24
  • 2
    Same issue but solved it by: `xrandr --newmode "1920" 220.64 1920 2056 2264 2608 1080 1081 1084 1128 -HSync +Vsync` - Added quotes around the mode and made it shorter. No idea why thou, but it worked. – zwessels Jul 31 '17 at 10:41

3 Answers3

81

Have you tried using a different name for that mode? I was getting this error and tried using the name "1080p" (e.g. xrandr --newmode "1080p"...) instead of the "1920x1080" name that I usually use and it worked. I'm not sure what's causing the error, as the 1920x1080 mode isn't even listed by xrandr, nor can it be removed via --rmmode, but creating a new mode with a different name seemed to work for me.

Tom
  • 819
  • 6
  • 3
15

I had a similar problem, I believe it was because I had already created that setting before (then rebooted). If I skip that stage and go straight to:

$ xrandr --addmode LVDS1 1280x720

in the terminal it does it straight away, maybe we were trying to create something that already exists in our system? If it's doing it on the first try though I can't come up with an explanation, sorry, I'm new to working with ubuntu code, 9.04 worked perfectly, upgrading to 10.10 is a bit more of a headache!

Hope it works for someone else.

Dean
  • 151
  • 1
  • 2
3

A late chime in, but try using arandr instead. It may life easier using a visual configuration tool rather than the arcane configuration options of xrandr.

Sasha
  • 544
  • 7
  • 5
  • 11
    ARandR only offers some functionality of xrandr, so this suggestion is not helpful in this instance. – Phil Ricketts May 03 '16 at 08:20
  • Even though arandr has less functionality (just a simple example, it doesn't show the refresh rate) I was able to solve my problem. I couldn't solve it using xrandr. Would anyone have a reasonable explanation why that is ? AFAIK, arandr is just a UI in front of xrandr – waykiki Mar 28 '23 at 15:47