Putting all available information together and researching a bit further here is what I came up with. No creating or editing of files and tedious research of command parameters. Just copy, paste and replace ${my_cursor_theme}
with your favorite theme.
Set the theme
# You need machinectl, which is not installed by default
sudo apt install --no-install-recommends systemd-container
# Change the theme for the GDM user to ${my_cursor_theme}
sudo machinectl shell gdm@ /bin/bash -c \
'gsettings set org.gnome.desktop.interface cursor-theme ${my_cursor_theme}'
I like KDE's dark Breeze cursor theme so I replaced ${my_cursor_theme}
with breeze_cursors
.
Finding a theme, and its name
If you don't know what cursor themes are installed on your machine—and which can be accessed by other users—you can use update-alternatives
to find out their names. Here is the output from my machine:
$ update-alternatives --display x-cursor-theme
x-cursor-theme - manual mode
link best version is /etc/X11/cursors/breeze_cursors.theme
link currently points to /usr/share/icons/DMZ-White/cursor.theme
link x-cursor-theme is /usr/share/icons/default/index.theme
/etc/X11/cursors/Breeze_Snow.theme - priority 41
/etc/X11/cursors/breeze_cursors.theme - priority 102
/etc/X11/cursors/core.theme - priority 30
/etc/X11/cursors/handhelds.theme - priority 20
/etc/X11/cursors/redglass.theme - priority 20
/etc/X11/cursors/whiteglass.theme - priority 20
/usr/share/icons/Adwaita/cursor.theme - priority 90
/usr/share/icons/DMZ-Black/cursor.theme - priority 30
/usr/share/icons/DMZ-White/cursor.theme - priority 100
update-alternatives --config x-cursor-theme
lets you choose the default cursor for other display managers, in case you didn't know that already.
Reset the theme
If you want to reset the theme this is probably your best option:
sudo machinectl shell gdm@ /bin/bash -c \
'gsettings reset org.gnome.desktop.interface cursor-theme'
Further resources I used
Screen locking
This only happens at login after reboot, i.e. when I wake from suspend or lock the PC, the cursor is the theme I want.
That is because what you are seeing is not your login manager or display manager but the lock screen of your desktop session. The Ubuntu developers took great efforts to make LightDM and now GDM3 and session lock screens look consistent in design, but they are separate components, — previously? — also involving a screensaver. There are—or were?—also some security implications which the author of xscreensaver is getting quite annoyed of.