Lightdm + dwm issues

Hey there.
I’ve recently switched to Nixos with lightdm + dwm. I am facing a couple of issues with cursor themes and keyboard repeat rate and would very much like some help with them.

First the repeat rate problem:

I’ve set the keyrepeat delay and interval as follows in my home-manager configuration.

server.xserver.autoRepeatDelay = 200;
server.xserver.autoRepeatInterval = 100;

From xserver.nix I see that these settings are passed to X. Sure enough, they are there when display manager runs.

● display-manager.service - X11 Server
     Loaded: loaded (/etc/systemd/system/display-manager.service; linked; preset: enabled)
     Active: active (running) since Wed 2023-09-06 15:12:35 PKT; 19min ago
    Process: 877 ExecStartPre=/nix/store/c8f3s53f7c6fw8hs6wnbz4xhhf9wqgxy-unit-script-display-manager-pre-start/bin/display-manager-pre-start (code=exited, status=0/SUCCESS)
   Main PID: 883 (lightdm)
         IP: 0B in, 0B out
         IO: 163.8M read, 124.0K written
      Tasks: 22 (limit: 14094)
     Memory: 258.8M
        CPU: 14.934s
     CGroup: /system.slice/display-manager.service
             ├─883 /nix/store/drc53rvbcqm28v10is2hqvxqhjg23gcx-lightdm-1.32.0/sbin/lightdm
             └─911 /nix/store/0kzisff5hir34fcpjhcclzh65xrwq88z-xorg-server-21.1.8/bin/X -config /nix/store/yfchpkpnknavmbqh7xh5df13gh8bxhha-xserver.conf -xkbdir /nix/store/sj99mv2wkgi37v78gs4x2k2liln4yy4l-xkeyboard-config-2.33/etc/navmbqh7xh5df13gh8bxhha-xserver.conf -xkbdir /nix/store/sj99mv2wkgi37v78gs4x2k2liln4yy4l-xkeyboard-config-2.33/etc/X11/xkb -logfile /dev/null -verbose 3 -nolisten tcp -ardelay 200 -arinterval 100 -terminate -logfile /var/log/X.0.lo11/xkb -logfile /dev/null -verbose 3 -nolisten tcp -ardelay 200 -arinterval 100 -terminate -logfile /var/log/X.0.log :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

But running xset -q shows no change in the repeat interval.

  auto repeat delay:  200    repeat rate:  10

Then there’s the problem with the cursor themes not changing:

I’ve set the following settings in my configuration.nix

  services = {
    xserver = {
      # Enable the X11 windowing system.
      enable = true;
      exportConfiguration = true;

      displayManager = {
        lightdm = {
          enable = true;
          greeters.gtk = {
              enable = true;
              theme.package = pkgs.flat-remix-gtk;
              iconTheme.package = pkgs.flat-remix-icon-theme;
              theme.name = "Flat-Remix-GTK-Dark-Blue";
              iconTheme.name = "Flat-Remix-Dark-Blue";
              cursorTheme = {
                package = pkgs.bibata-cursors;
                name = "Bibata-Modern-Ice";
              };
          };
        };
      };
  };

Here’s my home.nix

  gtk = {
    enable = true;
    theme.name = "Flat-Remix-GTK-Blue-Dark";
    iconTheme.name = "Flat-Remix-Blue-Dark";
    cursorTheme = {
      package = pkgs.bibata-cursors;
      name = "Bibata-Modern-Ice";
    };
    gtk2 = {
      configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
      extraConfig = ''
        gtk-application-prefer-dark-theme=true;
        gtk-font-name="Proxima Nova, 10";
        gtk-cursor-theme-size = 0
      '';
    };
    gtk3 = {
        extraCss = ''
          VteTerminal, vte-terminal {
            padding: 30px;
          }
        '';
        extraConfig = {
          "gtk-application-prefer-dark-theme" = true;
          "gtk-cursor-theme-size" = 0;
          "gtk-font-name" = "Proxima Nova, 10";
        };
    };
    gtk4.extraConfig = {
      "gtk-application-prefer-dark-theme" = true;
      "gtk-font-name" = "Proxima Nova, 10";
    };
  };

  qt = {
    enable = true;
    style.package = pkgs.libsForQt5.qtstyleplugins;
    platformTheme = "gtk";
  };

  home.pointerCursor = {
     gtk.enable = true;
     package = pkgs.bibata-cursors;
     name = "Bibata-Modern-Ice";
  };

Despite all this, there I still get the default cursor at the desktop, gtk cursor in firefox. If I run lxappearance, then my cursor changes theme to gtk on desktop but not on the dwm bar.

Update:

Repeat Rate
I fixed the repeat interval. I had to set the autoRepeatInterval to 10. This, for some reason, set my repeat rate to 100.

~
❯ xset -q
Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000000
  XKB indicators:
    00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: off
    03: Compose:     off    04: Kana:        off    05: Sleep:       off
    06: Suspend:     off    07: Mute:        off    08: Misc:        off
    09: Mail:        off    10: Charging:    off    11: Shift Lock:  off
    12: Group 2:     off    13: Mouse Keys:  off
  auto repeat delay:  200    repeat rate:  100

Cursor Themes
I still haven’t made much progress on this. I’ve read through some documentation and github issues and from what I understand, this is an issue with the default xcursors theme taking over. This part in dwm.c points to this being the case.

	/* init cursors */
	cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
	cursor[CurResize] = drw_cur_create(drw, XC_sizing);
	cursor[CurMove] = drw_cur_create(drw, XC_fleur);

I have updated my configs to the following

  xsession.enable = true;
  home.pointerCursor = {
    package = pkgs.bibata-cursors;
    name = "Bibata-Modern-Ice";
    size = 24;
    gtk.enable = true;
    x11.enable = true;
    x11.defaultCursor = "default";
  };

This adds the $XCURSOR_THEME and creates an index.theme in ~/.local/share/icons/default. This still doesn’t affect the cursor sadly.

Edit: Enabled xsession and corrected the x11.defaultCursor value. Now after logging in, I briefly see my cursor changing to Bibata-Modern-Ice and then changing back to the default one.