How to: Set default XTerm font and screen size

Discussion in 'General Discussion' started by josolanes, Nov 17, 2013.

  1. josolanes

    josolanes New Member

    Joined:
    Oct 14, 2013
    Messages:
    64
    Likes Received:
    0
    This is purely informational and something I found useful so I thought others might as well - how to set the default font, font size, and console size in Linux: Debian, Ubuntu, etc. This is very useful when you're using higher resolutions or a display that's further away

    This was compiled mostly from here: http://community.linuxmint.com/tutorial/view/1021
    ...and a bit of other searching as well allowed me to find how to set the default console size.

    Create or open the file at ~/.Xresources
    In Debian, the file doesn't exist so I simply created it

    To change the size of the font add this to the ~/.Xresources file:
    xterm*faceSize: 18
    18 above is an example - but change the size to preference

    If you're interested in using a TrueType font, run this command:
    fc-list :fontformat=TrueType -f "%{family}\n" | sort -u | less

    This will list the font names. You'll use the name of the font you'd like to use exactly as it is from the list - copy/paste is easiest if you choose to use one.

    Then add this to the ~/.Xresources file:
    xterm*faceName: Luxi Mono
    Where, in this example, Luxi Mono is the font I'm using - you can use any font from the TrueType list above and it should work just the same

    Now to set the size of the console itself, you would add this to the ~/.Xresources file:
    xterm*geometry: 127x37
    Where, in my example above, 127 is the number of characters wide that will be displayed and 37 is the number of lines that will be displayed. Change the values to suit the size you'd like XTerm to open as.

    So, my whole ~/.Xresources file looks like this:
    xterm*faceName: Luxi Mono
    xterm*faceSize: 18
    xterm*geometry: 127x37


    ...with nothing else in it :)

    I hope someone finds this useful! It's saved me quite a bit of squinting from the couch trying to read things on the TV from the couch ;)

    Also, if you'd like to temporarily change the font size in XTerm, you could also CTRL+Right Click (hold right click) and you'll see a menu show up. I just wanted a more permanent solution so it would open at the right size with the right font size every time without me having to change it at runtime.
     

Share This Page