-   Linux - Newbie (
-   -   FREAKISHLY URGENT: How can I change the screen res. through command lines? (

nealkochhar 06-09-2004 12:45 PM

FREAKISHLY URGENT: How can I change the screen res. through command lines?
Being the fool that I am, I set my resolution to 1600x1200.

It's all messed up there anyway I can change it back to 1280x1024 through command lines?

XavierP 06-09-2004 12:49 PM

Edit your XF86Config (or XF86Config-4) file and remove the offending resolution. I use nano or pico, you may have your own preferred editor.

The command (in my case) would be nano /path/to/XF86Config-4.

nealkochhar 06-09-2004 12:52 PM

Thanks but...where's the XFree86 usually located?

And what's the syntax I use to edit the file (just so I don't corrupt anything)?

Pete M 06-09-2004 01:02 PM


If you have other options available in your XFree86 file simply hold down the CTRL+ALT keys then press + or - on the numeric keypad


nealkochhar 06-09-2004 01:10 PM

Tried that and managed to edit the config file but still doesn't work..

Guess i'll just have to re-install :(

blueCow 06-09-2004 01:18 PM

NO!! You dont have to reinstall.. just edit your XF86Config file

run xf86config from the command line and change it to a lower res.

if you are stuck in x just Alt F2 to a new command line and then run it

nealkochhar 06-09-2004 01:20 PM

I tried that!

I edited /etc/X11/XF86Config and changed every damn 1600x1200 to 1280x1024!

Frank_Drebin 06-09-2004 01:24 PM


Your config file will vary depending on distribution. You may have both of these in your distro but only one actually does anything. If you cahnged XF86Config and it didn't help, see if you have XF86Config-4 and change it as well.

If you are running Mandrake its /etc/X11/XF86Config-4
If you are running Slackware its /etc/X11/XF86Config
try both and see where your's is

OK, that out of the way...

I use VI to edit files like this so I will walk you through it using VI

as root, do the following

vi /etc/X11/XF86Config

now look for the section dealing with screens

should look something like this:

Section "Screen"
    Identifier  "Screen 1"
    Device      "VESA Framebuffer"
    Monitor    "My Monitor"

#  DefaultDepth 8
#  DefaultDepth 16
  DefaultDepth 24
#  DefaultDepth 32

    Subsection "Display"
        Depth      8
        Modes "1280x1024/100Hz" "800x600" "640x480"
                Virtual 0 0
    Subsection "Display"
        Depth      16
        Modes "1280x1024/100Hz" "800x600" "640x480"
                Virtual 0 0
    Subsection "Display"
        Depth      24
        Modes "1280x1024/100Hz" "800x600" "640x480"
                Virtual 0 0
    Subsection "Display"
        Depth      32
        Modes "1280x1024/100Hz" "800x600" "640x480"
                Virtual 0 0

If you notice, you will see that my default depth is 24 so if we go to the line that shows Depth 24 we see all of the modes listed.

Your screen will default to the highest value so delete the "1600x1400" and make your desired resolution the highest one represented.

save it and start x.

another possibility is to change the following line if you see it in the monitor section of your XF86Config file:


ModeLine "1280x1024/100Hz" 181.75 1280 1312 1440 1696 1024 1031 1046 1072  -HSync -VSync
if you see the line above in your monitor section it is probably set to 1600x1400 instead. try changing that line or delete it and follow the first set of instructions above.

If you are unfamiliar with how to use vi here are some basic commands

type i or hit the insert key once to insert text
type r or hit hit the insert key twice to write over text
type esc (actually hit the key, don't type it) to stop inserting text

after hitting esc type :wq! to save changes and exit or :q! to exit without saving

nealkochhar 06-09-2004 01:27 PM

wow. Just wow.

But now I found the MODELINE and changed it to 800x600--didn't work. THen 1024--768--didn't work.

Frank_Drebin 06-09-2004 01:28 PM

what distro?

is it XF86Config or XF86Config-4 or do you have xorg.conf?

Frank_Drebin 06-09-2004 01:38 PM

If you want, you can IM me on yahoo instant messenger. try jbabbler as the username.

nealkochhar 06-09-2004 02:08 PM

Thanks for the offer but I've almost fnished the re-install.

But I might take you up on that as I'll need your help in compiling Kernel 2.6.6 on it (if that's cool with you?)

Thanks again

Frank_Drebin 06-09-2004 02:12 PM

Allright now, you have to get out of that mindset. ;)

You can't go around reinstalling everytime some little thing goes wrong. You will never learn anything. This aint Windows, anything you screw up can be fixed. :study:

But yes, you can IM me anytime and ask.

IsaacKuo 06-09-2004 02:30 PM

Just wondering--what Linux distro are you using?

Personally, I use Knoppix (Debian). The ONLY file I have ever edited to get resolutions working properly is /etc/X11/XF86Config-4. The other file /etc/X11/XF86Config exists, but is completely ignored by XFree v4.x if XF86Config-4 also exists.

In other words, completely ignore XF86Config. You only need to edit XF86Config-4. Do not waste your time with XF86Config.

You perhaps CAN get 1600x1200 to work--just at a lower refresh rate than the default. Do this by commenting out all of the 1600x1200 entries which have a refresh rate greater than 60. Personally, I think 1280x1024 is an abomination. I use 1280x960 instead, because it conforms to the standard 4:3 ratio of all other standard resolutions (resulting in square pixels).

nealkochhar 06-09-2004 03:29 PM

I'm using Slackware 9.1.

I didn't find a XF86Config-4 file, is there any other place I can locate it?

All times are GMT -5. The time now is 03:40 PM.