0

When I type this in a terminal I can disable the "num lock"

xmodmap -e "keycode 77 = """ 

Now I want to disable it on startup. I type,

sudo crontab -e

It opens a nano page in which I type

@reboot ~/.xmodmap -e "keycode 77 = """

Or

@reboot xmodmap -e "keycode 77 = """

But neither one works. what is the problem here?

Kian Maleki
  • 131
  • 3
  • You can't easily run X11 applications from cron. See e.g. https://unix.stackexchange.com/questions/10121/open-a-window-on-a-remote-x-display-why-cannot-open-display – Kusalananda Dec 08 '20 at 16:29
  • I read that page, I do not understand what they are talking about. What are the steps of the hard way to disable the "num lock"? – Kian Maleki Dec 08 '20 at 16:37
  • https://help.ubuntu.com/community/NumLock Useful read to enable/disable numlock at Ubuntus at various levels. Also I don't think cron should be involved at all. – thanasisp Dec 08 '20 at 17:00
  • More pointers: https://unix.stackexchange.com/questions/98068/keep-numlock-always-on (it should be fairly easy to invert the sense of the request in that question to "always off"). – Kusalananda Dec 08 '20 at 17:22
  • I read that page. "Always on" means disable. The most liked answer is to physically remove the num_lock key from the keyboard. lol. The other solutions are calling something after I log in which is something that I do. I found a solution which was turning the num lock on every 5 second which looks stupid to me. there should be a better way.

    My Ubuntu does not have "keyboard preference" (or Settings > Keyboard Layout > Options > Miscellaneous compatibility options) so I could not use https://help.ubuntu.com/community/NumLock.

    – Kian Maleki Dec 08 '20 at 17:49

0 Answers0