Reduce input latency for gaming with Gnome in NixOS
Recently I have started gaming in NixOS with Gnome, and everything is running smooth and slick, except a noticeable input latency, which is unbearable as I was playing shooter game.
After searching for a while, I realized that input latency can be reduced by enabling variable refresh rate (VRR). Gnome has added in experimental support for VRR starting from version 46, and it is disabled by default.
To enable this experimental feature, you have to use gsettings
or dconf
to add variable-refresh-rate
as an item of the value of /org/gnome/mutter/experimental-features
.
# if you prefer gsettings
gsettings set org.gnome.mutter experimental-features "['variable-refresh-rate']"
# if you prefer dconf
dconf write /org/gnome/mutter/experimental-features "['variable-refresh-rate']"
To do this the Nix way, if you are using Home Manager and you want to enable this feature on a user basis, you set this value through dconf.settings
.
{ inputs, lib, config, pkgs, ... }: {
dconf.settings = {
"org/gnome/mutter" = {
experimental-features = [ "variable-refresh-rate" ];
};
};
}