Find the answer to your Linux question:
Results 1 to 9 of 9
Is there a way to determine the current screen resolution from the command line? What about a way to change the resolution? Thanks....
  1. #1
    Just Joined!
    Join Date
    Jul 2006
    Posts
    17

    Screen Resolution from Command Line

    Is there a way to determine the current screen resolution from the command line? What about a way to change the resolution?

    Thanks.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by ldb88 View Post
    Is there a way to determine the current screen resolution from the command line? What about a way to change the resolution?

    Thanks.
    It depends on what you are speaking about.

    If you mean related to the X graphics driver, you should be able to retrieve some info and make adjustments using xrandr.

  3. #3
    oz
    oz is online now
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,095
    If you are talking about command line resolution, you can add the vga=xxx option to the kernel line in your /boot/grub/menu.lst file.

    Here's a table with the different values you can use:

    Code:
      FRAMEBUFFER RESOLUTION SETTINGS
         +-------------------------------------------------+
              | 640x480    800x600    1024x768    1280x1024
          ----+--------------------------------------------
          256 | 0x301=769  0x303=771  0x305=773   0x307=775
          32K | 0x310=784  0x313=787  0x316=790   0x319=793
          64K | 0x311=785  0x314=788  0x317=791   0x31A=794
          16M | 0x312=786  0x315=789  0x318=792   0x31B=795
         +-------------------------------------------------+
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

  4. #4
    Just Joined!
    Join Date
    Jul 2006
    Posts
    17
    Quote Originally Posted by i92guboj View Post
    It depends on what you are speaking about.

    If you mean related to the X graphics driver, you should be able to retrieve some info and make adjustments using xrandr.

    Thanks! Now my boss won't complain because he can't tell what's on the screen!

  5. #5
    Just Joined!
    Join Date
    Jul 2006
    Posts
    17
    Too late to edit, so I have to reply:

    xrandr worked on Ubuntu with the nVidia drivers installed. But when I got to my computer at work (CentOS), it doesn't work anymore.

    These are the commands I have tried:
    Code:
    xrandr -s 1280x1024
    xrandr -display $DISPLAY -s 1280x1024
    xrandr --screen Screen0 -s 1280x1024
    None of them have worked.

  6. #6
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,413
    What were the error messages?
    Registered Linux user #388328 || Registered LFS user #15880
    AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  7. #7
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Different versions of xrandr can use different syntax, so, be sure you use xrandr -h and read the man page if available. Note also that the machine might be configured to use different video modes.

    If your video card, monitor or driver doesn't support a given resolution, then it will not be available. The configuration of the Xorg server is also critical.

  8. #8
    Just Joined!
    Join Date
    Jul 2006
    Posts
    17
    There were no error messages. It just didn't do anything.

    I'm pretty sure I am using the correct syntax, since I have read the man page for the version I am using.

    The 1280x1024 is listed when I type xrandr -q so I assume it is supported.

    Strange things are happening, though. When I go to System->Preferences->Screen Resolution and tell it to change, it doesn't change anything. It shows the message asking if I want to keep the new resolution, but nothing changed. When I go back and check to see what it has as my current resolution, it still says the old one.

  9. #9
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Most problems about non-standard resolutions (those that are not 3:4, like the one you are trying to use) are often due to refresh rate settings.

    Make sure that you are specifying correct horizontal and vertical refresh ranges in your xorg.conf. Take them from the manual for your monitor. Maybe you will also need to write a Modeline line for that concrete mode.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...