how to set custom DPI with startx / without graphical login managers
English, Howto, Linux, Networkroll, Tips February 25th, 2007
While cleaning up my laptop of unnecessary crap I thought it might be useful to get rid of any graphical login manager as I don’t see any use in it any more. Just running startx should be enough so why wasting memory needlessly?!
The only thing I didn’t know was how to set my dpi manually as the automatically determined value resulted in quite weird and unreadable fonts using 72dpi. I used 86dpi on my laptop and defined that value in the kdmrc, which is part of the login manager shipped with kde: kdm, of which I wanted to get rid off.

The only thing I didn’t know was how to set my dpi manually as the automatically determined value resulted in quite weird and unreadable fonts using 72dpi. I used 86dpi on my laptop and defined that value in the kdmrc, which is part of the login manager shipped with kde: kdm, of which I wanted to get rid off.
After looking through the kdmrc I concluded that the values there are just piped to the Xserver so there must be a way of giving them to the Xserver directly. Using google I found the solution. The “defaultserverargs” argument is also available in the startx script which is located in “/usr/X11R6/bin/startx” so just edit it with
# nano -w /usr/X11R6/bin/startx
and search the argument “defaultserverargs” and add the following “-dpi 86″ setting the dpi to your preferred value. The line should look something like that after changing it:
defaultserverargs=”-nolisten tcp -dpi 86 -br”
These are the results (look exactly at the fonts and conky), on the left without setting the dpi manually and on the right after setting it:






February 26th, 2007 at 20:20
Yepp. Nice done.
But hey schischa. RTFM before you blog some shit ;)
man xorg.conf says:
DisplaySize width height
This optional entry gives the width and height, in millimetres, of the picture area of the monitor. If given, this is used to calculate the horizontal and vertical
pitch (DPI) of the screen.
And from now, Xorg will use the corect dpi when starting from $FOOBAR
Adding -dpi is evil when changing monitors.
February 26th, 2007 at 20:27
I read the fucking manual :P and it was the first thing I tried but doing this resulted in much too big fonts because the correct value for xorg wasn’t the value I prefered
btw that’s why I wrote this howto because everybody should be able to look at the manpage… but nobody wrote how it’s possible to set a specific DPI value manually, at least I didn’t find anything so I wrote it ;)
[quote]Adding -dpi is evil when changing monitors.[/quote]
wtf o_O how often do you change monitors :)