Xorg: Difference between revisions

From NixOS Wiki
imported>Mic92
hidpi: add java
imported>Mic92
No edit summary
Line 16: Line 16:
   };
   };
</pre>
</pre>
In NixOS unstable and NixOS 20.03 there is also a dedicated [HiDPI module](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/hidpi.nix):
<pre>
{
  hardware.video.hidpi.enable = true;
}
</pre>
This option will be included by default when using <code>nixos-config-generate</code> and it detects a screen larger than
fullhd. This will only set linux console fonts xserver dpi settings and environment variables still needs to be applied manually.


== Disabling mouse acceleration ==
== Disabling mouse acceleration ==

Revision as of 10:16, 28 July 2020

HiDPI

HiDPI (High Dots Per Inch) displays, also known by Apple's "Retina Display" marketing name, are screens with a high resolution in a relatively small format. They are mostly found in high-end laptops and monitors.

Not all software behaves well in high-resolution mode yet. Here are listed most common tweaks which make work on a HiDPI screen more pleasant:

  # bigger tty fonts
  console.font =
    "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
  services.xserver.dpi = 180;
  environment.variables = {
    GDK_SCALE = "2";
    GDK_DPI_SCALE = "0.5";
    _JAVA_OPTIONS = "-Dsun.java2d.uiScale=2";
  };

In NixOS unstable and NixOS 20.03 there is also a dedicated [HiDPI module](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/hidpi.nix):

{
  hardware.video.hidpi.enable = true;
}

This option will be included by default when using nixos-config-generate and it detects a screen larger than fullhd. This will only set linux console fonts xserver dpi settings and environment variables still needs to be applied manually.

Disabling mouse acceleration

To disable mouse acceleration for a touchpad, it's as simple as

  services.xserver.libinput.enable = true;
  services.xserver.libinput.accelProfile = "flat";

But to disable it for a mouse, it's a bit more wordy -

  services.xserver.libinput.enable = true;
  services.xserver.config = ''
    Section "InputClass"
      Identifier "mouse accel"
      Driver "libinput"
      MatchIsPointer "on"
      Option "AccelProfile" "flat"
      Option "AccelSpeed" "0"
    EndSection
  '';