Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Text Mode Screen Resolution

  1. #1
    Join Date
    Nov 2007
    Location
    UK
    Beans
    200
    Distro
    Ubuntu

    Text Mode Screen Resolution

    Hey,


    Is it possible to change the default screen resolution in a text-mode tty? Or, say, if you wanted to start Ubuntu without XWindows?


    Cosmic

  2. #2
    Join Date
    Aug 2008
    Location
    germany
    Beans
    857

    Re: Text Mode Screen Resolution

    Hello.

    Yes, sure it is.

    Add
    Code:
    vga=ask
    to your kernelline and you'll be prompted at the next boot, showing some default values. You may enter
    Code:
    scan
    then if you need more resolution settings.

    However, you should bear in mind or write down the number corresponding to your desired setting, and then make it a default.

    For example, this is my commandline
    docter[~] cat /proc/cmdline
    rhgb vga=0x365 acpi_osi="Linux"
    docter[~]
    The notifications may either be in vga, extended or vesa compliant values.
    This is,

    0x365 sets my display to 1440x900x24,
    869 does the same

    So if your line lists a versa driver, you will most probably have to use HEX annotation.

    See the kernel doc package for further specifications.
    /usr/share/doc/kernel-doc-2.6.30.5/Documentation/VGA-softcursor.txt
    /usr/share/doc/kernel-doc-2.6.30.5/Documentation/svga.txt
    /usr/share/doc/kernel-doc-2.6.30.5/Documentation/video-output.txt
    /usr/share/doc/kernel-doc-2.6.30.5/Documentation/power/video.txt
    /usr/share/doc/kernel-doc-2.6.30.5/Documentation/power/video_extension.txt
    and
    /usr/share/doc/kernel-doc-2.6.30.5/Documentation/x86/boot.txt
    /usr/share/doc/kernel-doc-2.6.30.5/Documentation/x86/x86_64/boot-options.txt

  3. #3
    Join Date
    Nov 2007
    Location
    UK
    Beans
    200
    Distro
    Ubuntu

    Re: Text Mode Screen Resolution

    Ok, great.

    How do I add vga=ask to the cmdline?

    My cmdline output is as follows;

    root=UUID=42d0d1e7-95f6-4561-96aa-09a808aa37b7 ro quiet splash

    Regards,

    Cosmic

  4. #4
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,430
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: Text Mode Screen Resolution

    Quote Originally Posted by CosmicFlux View Post
    How do I add vga=ask to the cmdline?
    Code:
    sudo nano /boot/grub/menu.lst
    None but ourselves can free our minds

  5. #5
    Join Date
    Aug 2008
    Location
    germany
    Beans
    857

    Re: Text Mode Screen Resolution

    And ↑ should be a line with default options.

    Like

    defopts=

    Don't uncomment it, it will be parsed as is. Add the proper value, hit ctrl + x to save and close it and run

    sudo update-grub

    Reboot, keep in mind which resultion fits your setup, reopen grub and add the proper value.

    And don't forget to update-grub afterwards.

  6. #6
    Join Date
    Nov 2007
    Location
    UK
    Beans
    200
    Distro
    Ubuntu

    Re: Text Mode Screen Resolution

    OK, thanx. That worked brilliantly. Until I rebooted that is. I then got no display at all.

    My file says;

    #defops=vga=323

    When it was set to vga=ask and I selected number 323 from the list, it worked but when I added the value 323 to the file I get no display.

    Any ideas?

    Is it possible to change the font colour to all one colour, say green or red?? I know you can do it in the graphical terminal by editing .bashrc, but is it possible to do in the actual command-line, say tty1?


    Cosmic
    Last edited by CosmicFlux; August 31st, 2009 at 05:03 PM.

  7. #7
    Join Date
    Aug 2008
    Location
    germany
    Beans
    857

    Re: Text Mode Screen Resolution

    Hi.

    It's not 323 but 0x323

    Thats the hexadecimal notation.

    vga=0x323

    *edit*
    @bashrc

    The "graphical terminal" is only a wrapper for the shell, so both will read .bashrc. Your shell prompt will look the same if you login with your account, regardless of runlevels.
    Last edited by loomsen; August 31st, 2009 at 11:13 PM.

  8. #8
    Join Date
    Nov 2007
    Location
    UK
    Beans
    200
    Distro
    Ubuntu

    Re: Text Mode Screen Resolution

    OK, so by editing .bashrc I can effect changes to the default command line too, even if I started Ubuntu up to run as just command line?

    I've looked at the colour codes but I can't seem to figure out how to make the colour apply to ALL output rather than just the prompt.

    Cosmic

  9. #9
    Join Date
    Aug 2008
    Location
    germany
    Beans
    857

    Re: Text Mode Screen Resolution

    Alright, it's probably easiest to implement some generic code you can easily refer to later on.

    Here's an example I have in my bashrc
    Code:
    # ======== Custom prompt
    # Define colors for readability
    #black="\[\033[0;30;49m\]"
    #blackgrey="\[\033[30;47m\]"
    _red="\[\033[31;49m\]"
    #green="\[\033[32;49m\]"
    #yellow="\[\033[33;49m\]"
    _blue="\[\033[34;49m\]"
    #magenta="\[\033[35;49m\]"
    #cyan="\[\033[36;49m\]"
    #white="\[\033[37;49m\]"
    r_color="\[\033[0m\]"           # Reset color
    #clr="\[\033[K\]"                # Clear to the end of the line
    
    if [ ${UID} -eq 0 ]; then
        user="$_blue\u"
    else
        user="$_red\u"
    fi
            
    PS1="$user[\w]$r_color "
    unset user r_color _red _blue
    See the r_color? As the comment reveals, that's the code to unset a color to it's default.
    I don't know why you would want to set everything to a different color, cause I actually use it for better readability and to quickly find the last command if I have to scroll back a whole bunch of line or so.
    Well, and most important to colorize my root prompt differently so I won't screw anything up. To achieve this, you will have to add it to your global bashrc tho, as you'd have to include a UID test.

    You can see above.

    So, one time environment settings → .profile
    Shell/terminal settings which apply upon every shell login → .bashrc
    And there's another file .bash_profile, which actually is the same as .profile. It will be executed only once, if it exists at all.

    So, configuring your color should go into .bashrc, while for example loading your video device settings would go into .bash_profile (.profile)

    If you want to include different colors too, it's pretty obvious why this has to be configured globally (→ /etc/bash.bashrc for example)

  10. #10
    Join Date
    Nov 2007
    Location
    UK
    Beans
    200
    Distro
    Ubuntu

    Re: Text Mode Screen Resolution

    Hmm OK, I've had a partial success. After setting the 'PS1=$' statement to include the colour code for bright green I now have the colour I want. The thing is, before logging in the colour is the default white. Can I change this to green also?

    Cosmic
    Last edited by CosmicFlux; September 1st, 2009 at 10:00 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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