SDDM Ignoring Cursor Theming

Hello, I am looking for some help with some trouble I am having with theming my cursor in sddm. At this point I feel like I have tried a billion different solutions but I haven’t seen any improvements.

My nixpkgs branch is nixos-unstable. As for the theme setting itself, I have the following, services.displayManager.sddm.settings.Theme.CursorTheme = "Bibata-Modern-Ice";

I appreciate any help given, thank you for your time.

Hi there,

First, which backend of sddm are you using?

If you are using Wayland for sddm (weston or kwin), make sure you have

services.displayManager.sddm. = {
  wayland.enable = true; # this sets weston as the wayland backend by default
  # if you do not set wayland.enable, it defaults to xserver
  settings = {
    Theme = {
      CursorTheme = "Bibata-Modern-Ice"; # the cursor name here matters
      # I would always go check the source nix file 
      # to see how the maintainers built and named it
      CursorSize = 24;
    };
  };
};

environment.systemPackages = [ pkgs.bibata-cursors ]; # cursor theme package

and it should work after sudo nixos-rebuild switch.

Now, if you are using xserver, unfortunately I’m struggling with this cursor theme setting as well. But if you don’t mind switching to wayland, then the above should do the job already.

Hope this helps! And if anybody know how to enable the cursor theme in xserver sddm, please let us know, i’m curious too :sweat_smile:

I am using xserver; my issue with wayland is that, while it does resolve this issue, it causes me a few other (more annoying) issues with my display. :person_shrugging:

Hi there,

So I’ve been testing this on xserver recently and got a solution. Add the following to your config:

services.displayManager.sddm = {
  setupScript = ''
    ${pkgs.xrdb}/bin/xrdb -merge - <<EOF
    Xcursor.theme: Bibata-Modern-Ice
    Xcursor.size: 24
    EOF
  '';
};

And this should work after rebuild. Be sure to also install your cursor theme:

environment.systemPackages = [
  pkgs.bibata-cursors
];

With this script you don’t need to mess up with services.displayManager.sddm.settings.Theme anymore, everything is controlled by xrdb.

Hope this helps!

By the way, don’t forget to add

services.xserver.enable = true;
1 Like

Thank you so much; at this point I had given up on fixing this so, suffice to say, this was a very welcome surprise. (And the solution was so simple too!)

If you were interested, here is my implementation of this:

let
	xresources = pkgs.writeText "xresources" ''
		Xcursor.theme: ${config.environment.sessionVariables.XCURSOR_THEME}
		Xcursor.size: ${config.environment.sessionVariables.XCURSOR_SIZE}
	'';
in
{
	services.displayManager.sddm.setupScript = ''
		# Set Cursor Theme and Size
		${pkgs.xrdb}/bin/xrdb -merge ${xresources}

		# Configure Monitor Layout
		/run/current-system/sw/bin/xrandr --output DisplayPort-0 --primary
		/run/current-system/sw/bin/xrandr --output HDMI-A-0 --off
	'';
}

Doing it with this let binding makes it sync with your already declared xcursor session variables (Also, I was having some issues with the following monitor commands because of the indents in your example but doing it like this lets you set it all in one line)

Looks good! let in makes this much cleaner and quoting from env vars is also a good idea. Will integrate into mine as well. Thanks!

1 Like