Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
0 answers
60 views
Numlock LED turns off, GDM login screen
My NumLock LED (and LED only, not the key functionality) is off on the GDM password input screen. Sometimes, the LED is already off when waking with NumLock on. If the LED is on when waking, it turns off when a key is pressed. I have tried both `gsettings set org.gnome.desktop.peripherals.keyboard r...
My NumLock LED (and LED only, not the key functionality) is off on the GDM password input screen. Sometimes, the LED is already off when waking with NumLock on. If the LED is on when waking, it turns off when a key is pressed. I have tried both gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state on and gsettings set org.gnome.desktop.peripherals.keyboard numlock-state on as myself and as user Debian-gdm. The NumLock LED behaviour seems to be inconsistent across sleep/wake cycles. Sometimes the LED's on, sometimes it's off, but NumLock proper (the number function) seems to be on across the board. I have to press NumLock twice to return it to its ON state with the LED on as well. Do you have any idea as to why that is, and how I could fix the issue?
Nicolas Landucci (1 rep)
Aug 12, 2024, 10:07 PM • Last activity: Aug 13, 2024, 01:52 PM
6 votes
1 answers
4491 views
turn on numlock at login screen. GDM
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 be...
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).
user746184 (103 rep)
May 8, 2015, 05:05 PM • Last activity: Sep 27, 2023, 11:04 AM
4 votes
4 answers
7511 views
NumLock is off on start-up on Linux Mint 18.2
I upgraded my OS to the latest version - Linux Mint 18.2 Sarah. After upgrading my NumLock is off. I changed my display manager from mdm to lightdm. [this method](https://unix.stackexchange.com/questions/275474/turn-on-numlock-on-startup-in-linux-mint) is not working.
I upgraded my OS to the latest version - Linux Mint 18.2 Sarah. After upgrading my NumLock is off. I changed my display manager from mdm to lightdm. [this method](https://unix.stackexchange.com/questions/275474/turn-on-numlock-on-startup-in-linux-mint) is not working.
mend4x (557 rep)
Jul 7, 2017, 07:38 AM • Last activity: Feb 1, 2023, 01:42 AM
12 votes
5 answers
11452 views
Turn NumLock on on startup?
I usually edit in __Vim__,and when pressing + , I'd rather move my hand to the right part of the keyboard where + resides rather than doing shift + = . But when NumLock is not on, in Vim it just opens a new line above and inserts the letter ***k***. And every time I start my PC NumLock is off. I wou...
I usually edit in __Vim__,and when pressing +, I'd rather move my hand to the right part of the keyboard where + resides rather than doing shift + =. But when NumLock is not on, in Vim it just opens a new line above and inserts the letter ***k***. And every time I start my PC NumLock is off. I would like to know if there is any xmodmap trick to turn on NumLock,so I could add it to my .xinitrc.And it would be even better if I could add it to my .map file which swaps Escape and CapsLock which I load with loadkeys in my /etc/rc.local on startup. I am using ___Arch Linux___.
bollovan (533 rep)
Jun 27, 2011, 09:34 AM • Last activity: Jul 5, 2022, 02:42 PM
46 votes
15 answers
27235 views
Keep NumLock always on
I have a standard keyboard with numerical keys on the right side (I guess it's called 104-key keyboard). I want to use the numerical keys only as numerical keys. That means I don't want the NumLock to switch on and off the numerical keys. However, sometimes it happens (I don't know how, perhaps by m...
I have a standard keyboard with numerical keys on the right side (I guess it's called 104-key keyboard). I want to use the numerical keys only as numerical keys. That means I don't want the NumLock to switch on and off the numerical keys. However, sometimes it happens (I don't know how, perhaps by me accidentally hitting the NumLock key) that the NumLock is turned off, and I have to press it again. This is extremely annoying. Is it possible to disable switching off NumLock? In other words: **I want my numerical keys to always act as number keys, and to disable the NumLock switch**. I am using Debian and LXDE (Openbox). UPDATE: ======== I have been using now for several years the solution, where I use in Openbox to execute a script when NumLock key is pressed. This script then turns NumLock on again. numlock-on.sh apart from being a dirty hack, this does not work reliably. Somehow, still it happens to me that the numlock key gets disabled on my keyboard. I am frustrated with the idea of a numlock key. The concept of numlock and Caps Lock are pure evil. Anyway, I tried the second solution, where I put the following into my openbox autostart script: xmodmap -e 'keycode 77 = Escape' but this does not work at all. First, when I log in to openbox, everything works fine, and the numerical keys work as numerical keys. But when I press numlock, it not only disables the numerical keys, but when I press 7 for example, I get OH, and then the numerical keys serve as arrow keys. Pressing NumLock key again does not enable numerical keys. I have to log out and log back in again. So the xmodmap solution did not work as expected. **How can I once and for all disable completely the *satanic* feature of NumLock key?**
Martin Vegter (598 rep)
Oct 29, 2013, 03:12 PM • Last activity: Jul 3, 2022, 11:57 AM
8 votes
1 answers
6112 views
Remember Numlock state after login in GNOME
I am running Debian GNOME 8.0. I would like to have Numlock ON as default. So I followed the instructions on this page: > https://wiki.archlinux.org/index.php/Activating_Numlock_on_Bootup#GDM replacing gdm by gdm3 for my case. This turns Numlock ON **at** login. But then, **after** login, Numlock is...
I am running Debian GNOME 8.0. I would like to have Numlock ON as default. So I followed the instructions on this page: > https://wiki.archlinux.org/index.php/Activating_Numlock_on_Bootup#GDM replacing gdm by gdm3 for my case. This turns Numlock ON **at** login. But then, **after** login, Numlock is automatically switched OFF again, and I cannot figure out how to leave it ON. I looked at this page : > https://unix.stackexchange.com/questions/98068/keep-numlock-always-on and edited my .bashrc file to add this line: xmodmap -e "keycode # = """ which works to disable Numlock key. But since Numlock is OFF when my session opens, I could not turn it ON anymore! Thus it did not solve my problem. That would be useful if my Numlock was ON by default. (I re-enabled the Numlock key). As information, I had initially installed Debian LXDE, but added GDM to switch to GNOME, and then removed and purged lxde* and lightdm*. I feel like this is the reason for my problem, since: - I found on the web that LXDE switches numlock OFF as default - my other computer, on which I installed Debian GNOME natively, does not have this problem. I am sure to be using GNOME since: pierre@Ockham:~$ echo $XDG_SESSION_DESKTOP gnome pierre@Ockham:~$ echo $GDMSESSION gnome pierre@Ockham:~$ echo $XDG_CURRENT_DESKTOP GNOME However, just in case lightdm would still play a role, I did try to follow the instructions on that page: > http://wiki.archlinux.org/index.php/LightDM#NumLock_on_by_default and that one: > http://linuxquestions.org/questions/debian-26/howto-debian-7-wheezy-lxde-auto-numlock-both-before-and-after-login-4175500323/ but it did not solve the problem. Does anybody have an idea? By the way, the /etc/xdg/ folder still contains LXDE and Openbox (which I also removed) folders: pierre@Ockham:/etc/xdg$ ls autostart libfm lxlauncher lxpanel lxsession menus openbox pcmanfm systemd user-dirs.conf user-dirs.defaults Is it normal or should I remove them? And how?
pmassat (141 rep)
Oct 12, 2015, 09:04 PM • Last activity: May 19, 2022, 03:40 PM
1 votes
0 answers
137 views
How to remember or apply Num Lock state based on which keyboard is connected?
I use my laptop on 2 different desks, both with different external keyboards. One of them I generally use with Num Lock on, the other with Num Lock off ([the only arrows it has are in the numpad][1], it's kinda weird but it's what I've got). Is there a way to: - Ideally, let the system remember a se...
I use my laptop on 2 different desks, both with different external keyboards. One of them I generally use with Num Lock on, the other with Num Lock off (the only arrows it has are in the numpad, it's kinda weird but it's what I've got). Is there a way to: - Ideally, let the system remember a separate Num Lock state for each keyboard? - Or to simply apply the preferred state when the keyboard is plugged in or the system boots with the keyboard connected? I'm on an up-to-date Arch Linux with KDE.
Bart van Heukelom (222 rep)
Feb 2, 2022, 12:42 PM
3 votes
0 answers
130 views
When switching tty, who is responsible for synchronizing the state of keyboard NumLock?
My Xorg program uses `tty1`. Use Ctrl + Alt + F[2~6] to switch between `ttY[2~6]`. At this time, the NumLock or CapsLock state (including the corresponding LED light on the keyboard) can be synchronized normally. If I switch between `tty1` and `tty[2~6]`, the NumLock or CapsLock state is normal, but...
My Xorg program uses tty1. Use Ctrl+Alt+F[2~6] to switch between ttY[2~6]. At this time, the NumLock or CapsLock state (including the corresponding LED light on the keyboard) can be synchronized normally. If I switch between tty1 and tty[2~6], the NumLock or CapsLock state is normal, but the keyboard light does not switch normally. I want to know, who is responsible for saving and switching the NumLock or CapsLock state of the tty keyboard (including the corresponding LED light on the keyboard)? Use evtest to monitor keyboard events, an example is as follows: scene 1: tty1: Num led is on, you can input numbers; tty2: Num Led is off, you cannot enter numbers; tty1-->tty2: Num led is on, no number can be input ctrl+alt+f2, tty1-->tty2, evtest print as follows: Event: time 1631671173.524324, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0 Event: time 1631671173.524324, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1 Event: time 1631671173.524324, -------------- SYN_REPORT ------------ Event: time 1631671173.612530, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2 Event: time 1631671173.612530, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1 Event: time 1631671173.612530, -------------- SYN_REPORT ------------ Event: time 1631671173.684525, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003b Event: time 1631671173.684525, type 1 (EV_KEY), code 60 (KEY_F2), value 1 Event: time 1631671173.684525, -------------- SYN_REPORT ------------ Event: time 1631671173.804507, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0 Event: time 1631671173.804507, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0 Event: time 1631671173.804507, -------------- SYN_REPORT ------------ Event: time 1631671173.812235, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2 Event: time 1631671173.812235, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0 Event: time 1631671173.812235, -------------- SYN_REPORT ------------ Event: time 1631671173.824310, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003b Event: time 1631671173.824310, type 1 (EV_KEY), code 60 (KEY_F2), value 0 Event: time 1631671173.824310, -------------- SYN_REPORT ------------ scene 2: tty2: Num led is on, you can input numbers; tty3: Num Led is off, you cannot enter numbers; tty2-->tty3: Num led is off, no number can be input ctrl+alt+f3, tty2-->tty3, evtest print as follows: Event: time 1631671357.985873, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0 Event: time 1631671357.985873, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1 Event: time 1631671357.985873, -------------- SYN_REPORT ------------ Event: time 1631671358.097893, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2 Event: time 1631671358.097893, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 1 Event: time 1631671358.097893, -------------- SYN_REPORT ------------ Event: time 1631671358.181861, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003c Event: time 1631671358.181861, type 1 (EV_KEY), code 61 (KEY_F3), value 1 Event: time 1631671358.181861, -------------- SYN_REPORT ------------ Event: time 1631671358.313866, type 17 (EV_LED), code 0 (LED_NUML), value 0 Event: time 1631671358.313866, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7003c Event: time 1631671358.313866, type 1 (EV_KEY), code 61 (KEY_F3), value 0 Event: time 1631671358.313866, -------------- SYN_REPORT ------------ Event: time 1631671358.321862, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0 Event: time 1631671358.321862, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0 Event: time 1631671358.321862, -------------- SYN_REPORT ------------ Event: time 1631671358.337870, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e2 Event: time 1631671358.337870, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0 Event: time 1631671358.337870, -------------- SYN_REPORT ------------
HeroesLoveToRoujiamo (31 rep)
Sep 15, 2021, 02:09 AM • Last activity: Sep 17, 2021, 11:15 AM
2 votes
1 answers
80 views
How to activate a deactivated num_lock?
I use the following code to deactivate the num lock key. xmodmap -e "keycode 77 = """ How can I activate the num lock key again? I think I have to use something like: xmodmap -e "keycode 77 = ? but I do not know what use instead of ?
I use the following code to deactivate the num lock key. xmodmap -e "keycode 77 = """ How can I activate the num lock key again? I think I have to use something like: xmodmap -e "keycode 77 = ? but I do not know what use instead of ?
Kian Maleki (131 rep)
Dec 17, 2020, 01:09 PM • Last activity: Dec 24, 2020, 07:43 PM
0 votes
0 answers
540 views
Ubuntu, disable "num lock" on startup using crontab
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 th...
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 rep)
Dec 8, 2020, 04:24 PM
0 votes
1 answers
70 views
Sticky keys with external keypad
I've defined my modifier keys (Shift, Alt, Ctrl) as sticky in terminal using `loadkeys` and the corresponding keymap definition. They behave as expected with the standard keyboard, but they are not sticky when used with the external keypad. The usual way, when you press the modifier key together wit...
I've defined my modifier keys (Shift, Alt, Ctrl) as sticky in terminal using loadkeys and the corresponding keymap definition. They behave as expected with the standard keyboard, but they are not sticky when used with the external keypad. The usual way, when you press the modifier key together with another key, works correctly.
Why? The keypad is a simple Genius keypad.
Plzak (1 rep)
Dec 2, 2020, 07:17 AM • Last activity: Dec 2, 2020, 07:31 AM
2 votes
1 answers
1707 views
How to deactivate num lock on Xubuntu on MacBook?
I just tried to resurrect an old MacBook by installing Xubuntu on it. However, I face a severe problem. Every time I start Xubuntu the num lock is on and there is no key on the MacBook to deactivate it. I have no idea why num lock is on at start. The keyboard works fine on Mac OS X. And sometimes af...
I just tried to resurrect an old MacBook by installing Xubuntu on it. However, I face a severe problem. Every time I start Xubuntu the num lock is on and there is no key on the MacBook to deactivate it. I have no idea why num lock is on at start. The keyboard works fine on Mac OS X. And sometimes after suspend on Xubuntu, the num lock gets deactivated for no apparent reason and I can use the machine until the next restart. Is there a way to disable num lock or so to solve the problem? I have already tried to update the system to the latest version. Edit: This question is particularly about Xubuntu. And the answer to the suggested duplicate differs from the selected answer.
Daniel (123 rep)
Oct 27, 2020, 06:37 AM • Last activity: Nov 19, 2020, 07:22 PM
2 votes
1 answers
745 views
Using the Numlock key as an equals key with XKB
The Numlock key sees little action in today's day and age, yet it's location in the (standard) keyboard layout is quite prominent. Since I use a lot of spreadsheets, using the keypad for data entry is very convenient, with one caveat: the equal sign is quite hard to reach, when your right hand is on...
The Numlock key sees little action in today's day and age, yet it's location in the (standard) keyboard layout is quite prominent. Since I use a lot of spreadsheets, using the keypad for data entry is very convenient, with one caveat: the equal sign is quite hard to reach, when your right hand is on the keypad. My idea was to re-map Numlock, such that it can act as both, Numlock and equals, with the former accessible through a modifier. For this purpose I decided to make my own xkb keymap, as I tried the same thing with xmodmap but I had similarly bad results. (file name is pb) default partial alphanumeric_keys xkb_symbols "basic" { name[Group1] = "PB (US intl with level 3 and level 5"; key.type[Group1] = "EIGHT_LEVEL"; include "us(altgr-intl)" // (norm) NLOCK AltGr key.type[Group1] = "FOUR_LEVEL_MIXED_KEYPAD"; key { [ KP_Equal, KP_Equal, Num_Lock, Q ] }; include "level3(ralt_switch)" include "level5(rctrl_switch)" }; Now, as you can see, I added level 3 and level 5, when I want to expand my custom layout later, but I tested withou it, and it doesn't interfere with Numlock. The behavior resulting from this is as follows when pressing the Numlock key: *(numlock is off)* * Numlock: '=' * Shift + Numlock: '=' * AltGr + Numlock: (switches Num lock on) * AltGr + Shift + Numlock: 'Q' *(I added this for testing)* This is alright, printing 'Q' when holding down AltGr and Shift was just to see if I can reach that shift level. However when Num lock is on, the behavior not satisfactory at all: *(numlock is on)* * Numlock: (switches Num lock off) * Shift + Numlock: (switches Num lock off) * AltGr + Numlock: (switches Num lock off) * AltGr + Shift + Numlock: (switches Num lock off) It seems to be impossible to make Num lock behave like a KP_Equal key, no matter what I try. Originally, I wanted pressing Numlock to print an equal sign, and when holding Shift, to operate Num Lock on and off. Since that didn't seem to be possible, I opted for ISO level 3 (AltGr), but that doesn't seem to work either. What I want is that Numlock prints an equal sign no matter if Num lock is on or off, and switch Num Lock when holding down a mod key (which one, isn't really important to me, preferably Shift or AltGr).
polemon (11921 rep)
Aug 4, 2020, 06:33 PM • Last activity: Sep 9, 2020, 11:56 PM
19 votes
3 answers
56883 views
Turn on NumLock on startup in Linux Mint in the Login window
**Situation:** When I turn on my Linux Mint 20/19/18/17 Cinnamon the NumLock is Off in the Login window. **Objective:** Turn on NumLock automatically at startup in the Login window.
**Situation:** When I turn on my Linux Mint 20/19/18/17 Cinnamon the NumLock is Off in the Login window. **Objective:** Turn on NumLock automatically at startup in the Login window.
Vlastimil Burián (30515 rep)
Apr 10, 2016, 09:00 AM • Last activity: Sep 6, 2020, 07:21 AM
0 votes
0 answers
185 views
Notification (DBus?) when CapsLock status is changed
I need a program, say a Python script, to be notified when the CapsLock and NumLock status are changed. I may have several keyboards and the code must run in user space so I can't rely on a kind of keylogger to receive KEY_CAPSLOCK events. Some tools fire visual notifications by running `xset q` in...
I need a program, say a Python script, to be notified when the CapsLock and NumLock status are changed. I may have several keyboards and the code must run in user space so I can't rely on a kind of keylogger to receive KEY_CAPSLOCK events. Some tools fire visual notifications by running xset q in a loop, but I can't find anything useful for receiving direct events. I don't want to use the xset method because I don't want to use a loop, I don't want to use an external tool and also that would need an X server.
PeterHerb (21 rep)
Jun 21, 2020, 11:00 AM • Last activity: Jun 21, 2020, 12:08 PM
1 votes
1 answers
720 views
Difference in NumPad processing in Linux vs Windows
On my Windows 8.1 machine if `NumLock` is `ON` and I press Shift+KP_1 Then `KP_1` acts as `KP_End` as it logically should. But in Linux(Manjaro/Fedora/Ubuntu/MX Linux) if `NumLock` is `ON` and I press Shift+KP_1 It still acts as `KP_1` and not as `KP_End`. **Why is there a difference in behaviour ?*...
On my Windows 8.1 machine if NumLock is ON and I press Shift+KP_1 Then KP_1 acts as KP_End as it logically should. But in Linux(Manjaro/Fedora/Ubuntu/MX Linux) if NumLock is ON and I press Shift+KP_1 It still acts as KP_1 and not as KP_End. **Why is there a difference in behaviour ?** **How do I get the numpad keys to act as End, Home, etc when NumPad is ON and Shift is pressed ?** Edit: VBox messes up the keystrokes. Don't use a tiling WM in VBox.
ng.newbie (1295 rep)
Feb 16, 2020, 07:28 PM • Last activity: Feb 18, 2020, 06:45 PM
2 votes
0 answers
1094 views
Numlock on by default on Linux Kali
I am fairly new to this version of Linux. I have it set so that when it boots, it automatically boots into the GUI for the operating system. This means when I load up the OS I am greeted with a login screen. My question is how to have it so NumLock is on by default at this point. I have looked at wa...
I am fairly new to this version of Linux. I have it set so that when it boots, it automatically boots into the GUI for the operating system. This means when I load up the OS I am greeted with a login screen. My question is how to have it so NumLock is on by default at this point. I have looked at ways of doing it and most the ways involve using NumLockX. I have gone off several forums on how to do it, [here](https://askubuntu.com/a/155683/491642) , [here](https://help.ubuntu.com/community/NumLock) , and [here](http://www.cyberciti.biz/faq/how-to-linux-turn-on-num-lock-on-gnome-startup/) . However they are for Ubuntu and Debian versions of Linux and they proved unsuccessful when I tried them on Kali. Is anyone aware of how to do it on Linux Kali? I would appreciate any help. Dan
Dan (121 rep)
Apr 21, 2016, 08:42 AM • Last activity: Dec 23, 2019, 06:39 PM
0 votes
2 answers
232 views
is there an alternative to numlockx for RHEL 7.6?
I'm setting up an offline RHEL 7.6 workstation (no network allowed, ever) and identifying all of the dependencies involved in using numlockx is becoming ridiculous. I'm trying to find out whether RHEL 7.6 provides the capability without needing the numlockx rpm.
I'm setting up an offline RHEL 7.6 workstation (no network allowed, ever) and identifying all of the dependencies involved in using numlockx is becoming ridiculous. I'm trying to find out whether RHEL 7.6 provides the capability without needing the numlockx rpm.
spemble (101 rep)
Jun 20, 2019, 05:04 PM • Last activity: Jun 20, 2019, 07:54 PM
3 votes
1 answers
654 views
Keep NumLock always in Linux Mint
I have a simple objective: **Keep NumLock always on** [OS][1] and [DE][2]: Linux Mint 17.3 / 18 Cinnamon I found this: [Keep NumLock always on][3] So, I created this small script -rwxr--r-- 1 root root 47 Apr 15 07:50 keep-numlock-on.sh with content #!/bin/bash xmodmap -e 'keycode 77 = NoSymbol' and...
I have a simple objective: **Keep NumLock always on** OS and DE : Linux Mint 17.3 / 18 Cinnamon I found this: Keep NumLock always on So, I created this small script -rwxr--r-- 1 root root 47 Apr 15 07:50 keep-numlock-on.sh with content #!/bin/bash xmodmap -e 'keycode 77 = NoSymbol' and I added it to sudo crontab -e like this @reboot /home/vlastimil/Development/bash/keep-numlock-on.sh 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. Further attempts: I created this file in ~/.config/autostart -rw-r--r-- 1 vlastimil vlastimil 308 Apr 15 10:00 NumLock.desktop with content [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 :( **EDIT1:** 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. **EDIT2:** sudoedit /etc/X11/xinit/xinitrc and placed the path to the file in there, still no luck. . /etc/X11/Xsession /home/vlastimil/Development/bash/keep-numlock-always-on.sh **EDIT3:** xmodmap messes up with my keyboard mappings, making it unusable for this purpose.
Vlastimil Burián (30515 rep)
Apr 15, 2016, 06:31 AM • Last activity: Apr 7, 2019, 05:21 AM
2 votes
2 answers
2906 views
Setxkbmap turns off NumLock LED - but not NumLock
Whenever I use setxkbmap in a terminal (or my .bashrc), the next time I press any modifier keys (ctrl, shift, alt) the NumLock LED on my keyboard goes off, but NumLock itself is still active so it's in some kind of inconsistent state. If I now press NumLock, the LED stays off but NumLock turns off,...
Whenever I use setxkbmap in a terminal (or my .bashrc), the next time I press any modifier keys (ctrl, shift, alt) the NumLock LED on my keyboard goes off, but NumLock itself is still active so it's in some kind of inconsistent state. If I now press NumLock, the LED stays off but NumLock turns off, and a second press on NumLock turns both the numpad and the LED on again. Curiously, while the LED is in this inconsistent state, pressing caps lock turns both the NumLock and CapsLock LEDs on. The command that I have in my .bashrc causing this is setxkbmap -option compose:ralt but it also happens if I issue a plain setxkbmap with no parameters, or do anything else with that command. Why is this happening (and am I doing something wrong)? Dump of Xorg -version(I'm running Xubuntu/XFCE): X.Org X Server 1.7.6 Release Date: 2010-03-17 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.24-30-server x86_64 Ubuntu Current Operating System: Linux xxxxx 2.6.32-41-generic #94-Ubuntu SMP Fri Jul 6 18:00:34 UTC 2012 x86_64 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.32-41-generic root=UUID=xxxxx ro quiet splash Build Date: 25 February 2012 06:57:33AM xorg-server 2:1.7.6-2ubuntu7.11 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.16.4
user21105
Aug 8, 2012, 09:41 AM • Last activity: Nov 26, 2018, 01:00 AM
Showing page 1 of 20 total questions