# Changing Xserver res from tty1



## xvi (Aug 4, 2008)

Any tips on how to change resolution from non-gui terminal such as terminal 1 on Ubuntu/gnome?

Example, I launch GameX and it sets my resolution to something that isn't supported. I go to tty1, log in and sudo kill. Switch back and resolution is still wrong.
Switch to tty1..

```
sudo xrandr -r 1680x1050
```
...but I just get "Can't open display"

Tried 
	
	



```
sudo xrandr --output tty7 -r 1680x1050
```
..but no go.

Setting resolution with xrandr from gnome's GUI terminal works fine.

Suggestions?


----------



## xfire (Aug 4, 2008)

sudo dpkg-reconfigure xserver-xorg

also hit ctrl+alt+del to restart x


----------



## xvi (Aug 4, 2008)

Do you mean ctrl+alt+backspace? I know about that..

The goal is to not restart X.


----------



## xfire (Aug 4, 2008)

the first command will do the trick.


----------



## xvi (Aug 4, 2008)

xfire said:


> the first command will do the trick.



You're sure? I tried it and it just rewrote xorg.conf


----------



## xfire (Aug 4, 2008)

yup. You even set the resolution.


----------



## xvi (Aug 4, 2008)

xfire said:


> yup. You even set the resolution.



..but rewriting xorg.conf doesn't take effect until I restart X? ..right? 

I'm hesitant to do so. My Radeon is a bit touchy when it comes to Ubuntu. I guess there's always a backup xorg.conf

Oh well, lets give it a try.


----------



## xvi (Aug 4, 2008)

Yeah. All it did was rewrite xorg.conf. Still need to restart X.

Like I say, the goal is to change the resolution from tty without restarting X.

I checked man before I posted and it shows me two promising options:


```
--screen snum
              This option selects which screen to manipulate. Note this refers
              to the X screen abstraction, not the monitor (or output).
```
and

```
--output <output>
              Selects an output to reconfigure. Use either  the  name  of  the
              output or the XID.
```

..but I can't figure out the syntax of these two commands. Giving them things like "/dev/tty7", "tty7" or "7"

Edit: I might have found something. Had the idea to run "xrandr -q" from GUI terminal to see what screen it reports. Says screen 0 (which I should have thought to try).

Wait a minute.. man page says it's "-screen" and error page says it's "--screen". I thought that looked funny. Still says "Can't open display"

Still, xrandr -q gives me this:

```
xvi@xvi-desktop:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 1680 x 1200
VGA-0 disconnected (normal left inverted right)
S-video disconnected (normal left inverted right)
DVI-0 connected 1680x1050+0+0 (normal left inverted right) 433mm x 270mm
   1680x1050      60.0*+
   1280x1024      75.0     59.9  
   1280x960       59.9  
   1152x864       75.0     74.8  
   1280x720       74.8     59.9  
   1024x768       75.1     70.1     60.0  
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   640x480        75.0     72.8     66.7     60.0  
   720x400        70.1
```
..which says "Screen 0" and --screen syntax asks for "snum".

Apparently there's also a "--display <display>" option that isn't in the man pages. I'll try that.


----------

