Linux GUI setup for monitors with High DPI

    Recently, there have been a lot of monitors with high resolution, 150 dbi and higher, especially on laptops. And while everything looks terribly small.
    The reason for this is that the system thinks that your monitor has a resolution of 96..100 dpi.
    Solving this only by increasing the font size is wrong, because the dimensions of all other interface elements remain small. It is necessary that the graphical shell itself does this.

    To solve this problem, I had to rummage around the Internet for a very long time, collecting small notes, because there was no place where it could be seen all together.

    Below is a list of where to fix something, I’ll give all the parameters for my monitor - 13.3 "at 2560x1600, this gives 226 dpi. I only saw higher resolution now in a Fujistu U904 laptop - 262 dpi.

    Monitor parameters: in xorg.conf in the monitor parameters add:
    Option “DPI” “226 x 226”
    DisplaySize 286 179 # is the same, but the screen size is set in millimeters
    If you do not have xorg.conf and you only have 1 monitor, then you can set this to the default monitor. To do this, the xorg.conf.d / 90-monitor.conf file with the following contents is created in the X configuration directory:
    Section "Monitor"
        Identifier ""
        Option "DPI" "226 x 226"
    End section

    In the X launch keys you need to add -dpi 226, in kdm this is the parameter string ServerArgsLocal

    For fonts in / etc / X11 / Xresourse or ~ / .Xresourse:
    replace Xft.dpi 96 with 226

    After restarting the claims, you can verify that this has taken effect:
    - in the X logs there should be such lines /var/log/Xorg.0.log
    intel (0): clock: 268.5 MHz Image Size: 286 x 179 mm
    intel (0): DPI set to (226, 226)
    - xdpyinfo | grep -B2 resolution
    screen # 0:
    dimensions: 2560x1600 pixels (287x179 millimeters)
    resolution: 227x227 dots per inch
    - xrdb -query | grep dpi
    Xft.dpi: 226

    But there are a bunch of programs and GUIs that don’t look at the X parameters. Therefore, we continue.

    For KDE: System Settings => Basic Appearance Settings => Fonts => Use a different DPI: 226.
    But the icons will have to be increased separately: System Settings => Basic Appearance Settings => Icons, Advanced tab.

    For Gnome: in gconf, write in / desktop / gnome / font_rendering / dpi (do I need something else here, I don’t know, because I don’t use Gnome).

    For Firefox: in about: config: layout.css.PixelsPerPx = 2.26, layout.css.dpi = 226.
    But often, the browser does not need 100% compliance, so I prescribed layout.css.PixelsPerPx = 2 to fit more on the screen. Although firefox provides the most accurate match for the image at 100 dpi, it uses the strange scaling of bitmap images. First, inside it receives an image that should have been at 100 dpi, and then it stretches 2 times. Because of this, the pictures turn out to be soapy even if they have a high resolution.

    For Opera: just set 200% masturbation - the opera does this correctly enough.

    For Chrome in chrome: // flags / there is a parameter "High resolution mode", but for linux it is not available. Therefore, it remains only to put 200% and a "very large" font size. Unfortunately, this does not affect flash.
    But I set it at 120% and use it to view maps (, for high detail pictures.

    Konqueror does not yet understand high dpi, and it does not scale correctly, although akregator, using the same engine, shows everything correctly without additional instructions.

    To verify that your dpi is understood by the system correctly, it is best to open an A4 page in an office program, for example OpenOffice, and with a 100% zoom, attach a paper sheet. If everything works correctly, then the sizes will match.
    Also in OpenOffice in the settings it is worth setting the size of the icons to “large”.

    After all the settings, there were conflicts of hardcoded bitmap images and enlarged fonts.
    I saw this in kdm and in Opera: it’s possible to work, but it doesn’t look very nice - the edges of letters come out for the fields allotted for inscriptions. Therefore, in Xresourse I replaced 226 with 175. (In general, it is strange that opera, reading the dpi size for menus and other labels, does not use the same dpi to display the html page).

    PS It was originally intended only for myself here , but it turned out that now many people have such a question. I will be glad if there are any constructive additions.

    Also popular now: