5

GDM is turning off numlock key.

I have tried following:

a) installing numlockx and inserting following lines at /etc/gdm/Init/Default
if [ -x /usr/bin/numlockx ]; then
    /usr/bin/numlockx on
fi

b) Using setleds +num, but it corrupts the numlock state.

When I reboot the system or gdm.service

Numlock becomes on at boot
Numlock turns off at login screen[GDM]
Numlock again turns on after login. [ KDE / GNOME ]

How can I ensure numlock is always on at login (gdm).

John Militer
  • 773
  • 4
  • 14
  • 29
user746184
  • 93
  • 1
  • 6
  • Did none of the methods mentioned here work : https://wiki.archlinux.org/index.php/Activating_Numlock_on_Bootup ? – shivams May 09 '15 at 07:34
  • No, none of them worked. I have already tried them. Numlock was turned on before the login screen but during the login screen is displayed it turns off. – user746184 May 11 '15 at 15:43
  • 2
    @user746184 - try setting it via gsettings as the _gdm_ user - as I explained [here](http://unix.stackexchange.com/q/205058). Use `gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state on` instead of the command I used there... – don_crissti Jun 03 '15 at 12:49
  • Have you tried putting your `numlockx on` script in `less /etc/gdm3/PreSession/Default`? – Matthias Jul 30 '15 at 17:07

1 Answers1

0

following the tip by @don_crissti i successfully enabled numlock on gdm login screen like this:

sudo su #become root
su gdm -s /bin/sh #become gdm user with a shell
#do the work i don't 100% understand
export $(dbus-launcher) 
GSETTINGS_BACKEND=dconf gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state on
exit #drop back to root user
systemctl restart gdm #restart gdm
ben_wing
  • 103
  • 3