This question already has an answer here:
I have a simple objective: Keep NumLock always on
I found this:
So, I created this small script
-rwxr--r-- 1 root root 47 Apr 15 07:50 keep-numlock-on.sh
#!/bin/bash xmodmap -e 'keycode 77 = NoSymbol'
and I added it to
sudo crontab -e like this
To my surprise, it does not work on reboot and I have no clue as to why.
It works if I manually call the script.
Any help appretiated.
I created this file in
-rw-r--r-- 1 vlastimil vlastimil 308 Apr 15 10:00 NumLock.desktop
[Desktop Entry] Encoding=UTF-8 Name=Keep NumLock always on GenericName=Keep NumLock always on Comment=Keep NumLock always on Exec=/home/vlastimil/Development/bash/keep-numlock-always-on.sh Icon= Terminal=true Type=Application Categories= X-GNOME-Autostart-enabled=true Hidden=false X-GNOME-Autostart-Delay=0
while renaming the script and changing rights to
-rwxrwxrwx 1 vlastimil vlastimil 47 Apr 15 09:56 keep-numlock-always-on.sh
in order to rule out permission issue.
Well, I don't know what I did wrong, but it still does not work :(
As for the comments, I changed the contents of the script to:
#!/bin/bash /usr/bin/numlockx on DISPLAY=":0" xmodmap -e 'keycode 77 = NoSymbol'
But without luck. This is really annoying to me. Please help and if you solve it, you will be rewarded with 50 points. Thank you.
and placed the path to the file in there, still no luck.
. /etc/X11/Xsession /home/vlastimil/Development/bash/keep-numlock-always-on.sh
xmodmap messes up with my keyboard mappings, making it unusable for this purpose.