Skip to content

Instantly share code, notes, and snippets.

@themattchan
Created November 18, 2018 05:24
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save themattchan/55d21a524955111913afd7e1e22ce811 to your computer and use it in GitHub Desktop.
Save themattchan/55d21a524955111913afd7e1e22ce811 to your computer and use it in GitHub Desktop.
nixos: fix cursor size

Fix cursor size in nixos/linux

  1. Set your XCURSOR_SIZE to 32 (or desired size) in either your /etc/nixos/configuration.nix
environment.variables.XCURSOR_SIZE = "32";

or ~/.Xresources:

Xcursor.size: 32
  1. in ~/.Xresources, set the theme to Adwaita. (You'd want the gnome3.adwaita-icon-theme nix package installed.)
Xcursor.theme: Adwaita
  1. in ~/.gtkrc-2.0 set the following:
gtk-cursor-theme-name="Adwaita"
gtk-cursor-theme-size=32
  1. in ~/.config/gtk-3.0/settings.ini set the following:
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=32
  1. Logout and log back in. (If you changed /etc/nixos/configuration.nix do a sudo nix-rebuild switch and reboot.)

Change the size and theme as desired -- just make sure that the settings in the above files are in sync.

@amarshall
Copy link

If using Home Manager, then this is encapsulated by e.g.

{ pkgs, ... }: {
  xsession.pointerCursor = {
    name = "Adwaita";
    package = pkgs.gnome.adwaita-icon-theme;
    size = 32;
  };
}

Despite being "xsession", Wayland desktops benefit from some of what this does as well.

@leana8959
Copy link

I got the notification that xsession.pointerCursor is being deprecated, and I found the new option here https://nix-community.github.io/home-manager/options.xhtml#opt-home.pointerCursor
Hope this helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment