Disable num lock indicator LED or reverse keypad so when num lock is on, indicator light is off












5















I am using Debian Testing/Stretch with Xfce. I just bought this wired keyboard. I would like the num lock to be turned on by default, but I do not want to have the led indicator light on. This could be accomplished by disabling the num lock indicator altogether, reversing the state (showing the indicator light when the num lock is off), or all of the num-lock-off keys could be remapped to type numbers instead (with this I can type numbers when the indicator is on or off). setleds -L -num works but only in a tty session. Thanks










share|improve this question





























    5















    I am using Debian Testing/Stretch with Xfce. I just bought this wired keyboard. I would like the num lock to be turned on by default, but I do not want to have the led indicator light on. This could be accomplished by disabling the num lock indicator altogether, reversing the state (showing the indicator light when the num lock is off), or all of the num-lock-off keys could be remapped to type numbers instead (with this I can type numbers when the indicator is on or off). setleds -L -num works but only in a tty session. Thanks










    share|improve this question



























      5












      5








      5


      1






      I am using Debian Testing/Stretch with Xfce. I just bought this wired keyboard. I would like the num lock to be turned on by default, but I do not want to have the led indicator light on. This could be accomplished by disabling the num lock indicator altogether, reversing the state (showing the indicator light when the num lock is off), or all of the num-lock-off keys could be remapped to type numbers instead (with this I can type numbers when the indicator is on or off). setleds -L -num works but only in a tty session. Thanks










      share|improve this question
















      I am using Debian Testing/Stretch with Xfce. I just bought this wired keyboard. I would like the num lock to be turned on by default, but I do not want to have the led indicator light on. This could be accomplished by disabling the num lock indicator altogether, reversing the state (showing the indicator light when the num lock is off), or all of the num-lock-off keys could be remapped to type numbers instead (with this I can type numbers when the indicator is on or off). setleds -L -num works but only in a tty session. Thanks







      x11 keyboard keyboard-layout






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 16 '17 at 0:00









      Gilles

      541k12810951611




      541k12810951611










      asked Jan 15 '17 at 23:35









      jbrockjbrock

      374415




      374415






















          3 Answers
          3






          active

          oldest

          votes


















          6














          You can invert the meaning of Num Lock. With Xmodmap, put this in your .Xmodmap.



          keycode  79 = KP_Home KP_7 KP_Home KP_7 KP_Home KP_7 KP_Home KP_7
          keycode 80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8 KP_Up KP_8
          keycode 81 = KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9
          keycode 83 = KP_Left KP_4 KP_Left KP_4 KP_Left KP_4 KP_Left KP_4
          keycode 84 = KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5
          keycode 85 = KP_Right KP_6 KP_Right KP_6 KP_Right KP_6 KP_Right KP_6
          keycode 87 = KP_End KP_1 KP_End KP_1 KP_End KP_1 KP_End KP_1
          keycode 88 = KP_Down KP_2 KP_Down KP_2 KP_Down KP_2 KP_Down KP_2
          keycode 89 = KP_Next KP_3 KP_Next KP_3 KP_Next KP_3 KP_Next KP_3
          keycode 90 = KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0
          keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal


          You may need to add xmodmap ~/.Xmodmap to your startup applications, I'm not sure if Xfce does this by default.



          Doing it this way has the advantage that most of the time, you won't have NumLock on. A few programs have trouble with NumLock because they consider it to be a modifier and that causes their keyboard shortcuts not to work when it's on.



          If you never turn off NumLock, you can disable the NumLock key while you're at it.



          keycode 77 = NoSymbol


          If you enjoy pain, you can use XKB instead. Here's my configuration which effectively makes NumLock always on. Create a file ~/.xkb/types/mytypes containing



          // Digits without NumLock, cursor with NumLock. Shift swaps the meaning.
          // Do it this way because I almost always want digits, but the NumLock state
          // breaks key bindings in some applications.
          partial xkb_types "invert_numlock" {
          type "KEYPAD" {
          modifiers = Shift+NumLock;
          map[None] = Level2;
          map[Shift] = Level1;
          map[NumLock] = Level1;
          map[Shift+NumLock] = Level2;
          level_name[Level1] = "Base";
          level_name[Level2] = "Number";
          };
          include "extra(keypad)"
          };


          Create a file ~/.xkb/symbols/mysymbols containing:



          partial xkb_symbols "mykeypad" {
          key <KP7> { [ KP_7, KP_Home ] };
          key <KP8> { [ KP_8, KP_Up ] };
          key <KP9> { [ KP_9, KP_Prior ] };
          key <KP4> { [ KP_4, KP_Left ] };
          key <KP5> { [ KP_5, KP_Begin ] };
          key <KP6> { [ KP_6, KP_Right ] };
          key <KP1> { [ KP_1, KP_End ] };
          key <KP2> { [ KP_2, KP_Down ] };
          key <KP3> { [ KP_3, KP_Next ] };
          key <KP0> { [ KP_0, KP_Insert ] };
          key <KPDL> { [ KP_Decimal, KP_Delete ] };
          };


          Run the following shell command as part of your X initialization startup (add other options to the setxkbmap call as desired):



          setxkbmap -types "complete+mytypes(invert_numlock)" 
          -symbols "us+compose(menu)+mysymbols(mykeypad)"
          -print | xkbcomp -I ~/.xkb - "$DISPLAY"





          share|improve this answer


























          • I've created ~/.Xmodmap (correcting KPDelete on last line). I've set xmodmap ~/.Xmodmap to run at login. I've logged out and in again and even rebooted. When I run xmodmap ~/.Xmodmap in the terminal it does not return any error. The keys remap is not working for some reason. I wonder if there is a way I could remap using the /etc/default/keyboard file instead, perhaps the XKBOPTIONS. I use this file to swap my caps and escape keys for Vim. It is fine if it is a system-wide change. No one else uses my machine. Thanks

            – jbrock
            Jan 16 '17 at 0:50











          • @jbrock Strange. This comes directly from my configuration (I have numlock effectively always on), and I don't see why it wouldn't work everywhere (assuming you have a PC keyboard and a Linux installation from the last decade or so). You can do the same thing with XKB, but it's harder, there's no option for that, you have to build your own settings. I have code to do it though, I'll edit my answer.

            – Gilles
            Jan 16 '17 at 10:30













          • I tried the second solution (the one involving pain), but the setxkbmap command threw an error. I give up on the software solution. So, I just popped the key off and put a little black paint I had over the transparent part inside the key. Minor annoyance gone. Thanks for the thorough answer. You have my upvote. :)

            – jbrock
            Jan 17 '17 at 4:57











          • I also tried the first solution with a different keyboard, and it did not work with it either. It must be something strange with my system.

            – jbrock
            Jan 17 '17 at 4:59



















          1














          You might be able to turn off the led in X11 each time you give the command



          xset -led named "Num Lock"


          or try explicit numbers like xset -led 3.






          share|improve this answer































            0














            If “num lock turned on by default” means “keys on the numpad by default” and you don’t want/don’t care about navigation on the keypad:



            setxkbmap -option numpad:mac <layout>


            So for the us layout:



            setxkbmap -option numpad:mac us


            Now the numpad always enters digits, no matter the num lock state.



            Reference: xkeyboard-config man-page






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f337647%2fdisable-num-lock-indicator-led-or-reverse-keypad-so-when-num-lock-is-on-indicat%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              6














              You can invert the meaning of Num Lock. With Xmodmap, put this in your .Xmodmap.



              keycode  79 = KP_Home KP_7 KP_Home KP_7 KP_Home KP_7 KP_Home KP_7
              keycode 80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8 KP_Up KP_8
              keycode 81 = KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9
              keycode 83 = KP_Left KP_4 KP_Left KP_4 KP_Left KP_4 KP_Left KP_4
              keycode 84 = KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5
              keycode 85 = KP_Right KP_6 KP_Right KP_6 KP_Right KP_6 KP_Right KP_6
              keycode 87 = KP_End KP_1 KP_End KP_1 KP_End KP_1 KP_End KP_1
              keycode 88 = KP_Down KP_2 KP_Down KP_2 KP_Down KP_2 KP_Down KP_2
              keycode 89 = KP_Next KP_3 KP_Next KP_3 KP_Next KP_3 KP_Next KP_3
              keycode 90 = KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0
              keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal


              You may need to add xmodmap ~/.Xmodmap to your startup applications, I'm not sure if Xfce does this by default.



              Doing it this way has the advantage that most of the time, you won't have NumLock on. A few programs have trouble with NumLock because they consider it to be a modifier and that causes their keyboard shortcuts not to work when it's on.



              If you never turn off NumLock, you can disable the NumLock key while you're at it.



              keycode 77 = NoSymbol


              If you enjoy pain, you can use XKB instead. Here's my configuration which effectively makes NumLock always on. Create a file ~/.xkb/types/mytypes containing



              // Digits without NumLock, cursor with NumLock. Shift swaps the meaning.
              // Do it this way because I almost always want digits, but the NumLock state
              // breaks key bindings in some applications.
              partial xkb_types "invert_numlock" {
              type "KEYPAD" {
              modifiers = Shift+NumLock;
              map[None] = Level2;
              map[Shift] = Level1;
              map[NumLock] = Level1;
              map[Shift+NumLock] = Level2;
              level_name[Level1] = "Base";
              level_name[Level2] = "Number";
              };
              include "extra(keypad)"
              };


              Create a file ~/.xkb/symbols/mysymbols containing:



              partial xkb_symbols "mykeypad" {
              key <KP7> { [ KP_7, KP_Home ] };
              key <KP8> { [ KP_8, KP_Up ] };
              key <KP9> { [ KP_9, KP_Prior ] };
              key <KP4> { [ KP_4, KP_Left ] };
              key <KP5> { [ KP_5, KP_Begin ] };
              key <KP6> { [ KP_6, KP_Right ] };
              key <KP1> { [ KP_1, KP_End ] };
              key <KP2> { [ KP_2, KP_Down ] };
              key <KP3> { [ KP_3, KP_Next ] };
              key <KP0> { [ KP_0, KP_Insert ] };
              key <KPDL> { [ KP_Decimal, KP_Delete ] };
              };


              Run the following shell command as part of your X initialization startup (add other options to the setxkbmap call as desired):



              setxkbmap -types "complete+mytypes(invert_numlock)" 
              -symbols "us+compose(menu)+mysymbols(mykeypad)"
              -print | xkbcomp -I ~/.xkb - "$DISPLAY"





              share|improve this answer


























              • I've created ~/.Xmodmap (correcting KPDelete on last line). I've set xmodmap ~/.Xmodmap to run at login. I've logged out and in again and even rebooted. When I run xmodmap ~/.Xmodmap in the terminal it does not return any error. The keys remap is not working for some reason. I wonder if there is a way I could remap using the /etc/default/keyboard file instead, perhaps the XKBOPTIONS. I use this file to swap my caps and escape keys for Vim. It is fine if it is a system-wide change. No one else uses my machine. Thanks

                – jbrock
                Jan 16 '17 at 0:50











              • @jbrock Strange. This comes directly from my configuration (I have numlock effectively always on), and I don't see why it wouldn't work everywhere (assuming you have a PC keyboard and a Linux installation from the last decade or so). You can do the same thing with XKB, but it's harder, there's no option for that, you have to build your own settings. I have code to do it though, I'll edit my answer.

                – Gilles
                Jan 16 '17 at 10:30













              • I tried the second solution (the one involving pain), but the setxkbmap command threw an error. I give up on the software solution. So, I just popped the key off and put a little black paint I had over the transparent part inside the key. Minor annoyance gone. Thanks for the thorough answer. You have my upvote. :)

                – jbrock
                Jan 17 '17 at 4:57











              • I also tried the first solution with a different keyboard, and it did not work with it either. It must be something strange with my system.

                – jbrock
                Jan 17 '17 at 4:59
















              6














              You can invert the meaning of Num Lock. With Xmodmap, put this in your .Xmodmap.



              keycode  79 = KP_Home KP_7 KP_Home KP_7 KP_Home KP_7 KP_Home KP_7
              keycode 80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8 KP_Up KP_8
              keycode 81 = KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9
              keycode 83 = KP_Left KP_4 KP_Left KP_4 KP_Left KP_4 KP_Left KP_4
              keycode 84 = KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5
              keycode 85 = KP_Right KP_6 KP_Right KP_6 KP_Right KP_6 KP_Right KP_6
              keycode 87 = KP_End KP_1 KP_End KP_1 KP_End KP_1 KP_End KP_1
              keycode 88 = KP_Down KP_2 KP_Down KP_2 KP_Down KP_2 KP_Down KP_2
              keycode 89 = KP_Next KP_3 KP_Next KP_3 KP_Next KP_3 KP_Next KP_3
              keycode 90 = KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0
              keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal


              You may need to add xmodmap ~/.Xmodmap to your startup applications, I'm not sure if Xfce does this by default.



              Doing it this way has the advantage that most of the time, you won't have NumLock on. A few programs have trouble with NumLock because they consider it to be a modifier and that causes their keyboard shortcuts not to work when it's on.



              If you never turn off NumLock, you can disable the NumLock key while you're at it.



              keycode 77 = NoSymbol


              If you enjoy pain, you can use XKB instead. Here's my configuration which effectively makes NumLock always on. Create a file ~/.xkb/types/mytypes containing



              // Digits without NumLock, cursor with NumLock. Shift swaps the meaning.
              // Do it this way because I almost always want digits, but the NumLock state
              // breaks key bindings in some applications.
              partial xkb_types "invert_numlock" {
              type "KEYPAD" {
              modifiers = Shift+NumLock;
              map[None] = Level2;
              map[Shift] = Level1;
              map[NumLock] = Level1;
              map[Shift+NumLock] = Level2;
              level_name[Level1] = "Base";
              level_name[Level2] = "Number";
              };
              include "extra(keypad)"
              };


              Create a file ~/.xkb/symbols/mysymbols containing:



              partial xkb_symbols "mykeypad" {
              key <KP7> { [ KP_7, KP_Home ] };
              key <KP8> { [ KP_8, KP_Up ] };
              key <KP9> { [ KP_9, KP_Prior ] };
              key <KP4> { [ KP_4, KP_Left ] };
              key <KP5> { [ KP_5, KP_Begin ] };
              key <KP6> { [ KP_6, KP_Right ] };
              key <KP1> { [ KP_1, KP_End ] };
              key <KP2> { [ KP_2, KP_Down ] };
              key <KP3> { [ KP_3, KP_Next ] };
              key <KP0> { [ KP_0, KP_Insert ] };
              key <KPDL> { [ KP_Decimal, KP_Delete ] };
              };


              Run the following shell command as part of your X initialization startup (add other options to the setxkbmap call as desired):



              setxkbmap -types "complete+mytypes(invert_numlock)" 
              -symbols "us+compose(menu)+mysymbols(mykeypad)"
              -print | xkbcomp -I ~/.xkb - "$DISPLAY"





              share|improve this answer


























              • I've created ~/.Xmodmap (correcting KPDelete on last line). I've set xmodmap ~/.Xmodmap to run at login. I've logged out and in again and even rebooted. When I run xmodmap ~/.Xmodmap in the terminal it does not return any error. The keys remap is not working for some reason. I wonder if there is a way I could remap using the /etc/default/keyboard file instead, perhaps the XKBOPTIONS. I use this file to swap my caps and escape keys for Vim. It is fine if it is a system-wide change. No one else uses my machine. Thanks

                – jbrock
                Jan 16 '17 at 0:50











              • @jbrock Strange. This comes directly from my configuration (I have numlock effectively always on), and I don't see why it wouldn't work everywhere (assuming you have a PC keyboard and a Linux installation from the last decade or so). You can do the same thing with XKB, but it's harder, there's no option for that, you have to build your own settings. I have code to do it though, I'll edit my answer.

                – Gilles
                Jan 16 '17 at 10:30













              • I tried the second solution (the one involving pain), but the setxkbmap command threw an error. I give up on the software solution. So, I just popped the key off and put a little black paint I had over the transparent part inside the key. Minor annoyance gone. Thanks for the thorough answer. You have my upvote. :)

                – jbrock
                Jan 17 '17 at 4:57











              • I also tried the first solution with a different keyboard, and it did not work with it either. It must be something strange with my system.

                – jbrock
                Jan 17 '17 at 4:59














              6












              6








              6







              You can invert the meaning of Num Lock. With Xmodmap, put this in your .Xmodmap.



              keycode  79 = KP_Home KP_7 KP_Home KP_7 KP_Home KP_7 KP_Home KP_7
              keycode 80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8 KP_Up KP_8
              keycode 81 = KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9
              keycode 83 = KP_Left KP_4 KP_Left KP_4 KP_Left KP_4 KP_Left KP_4
              keycode 84 = KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5
              keycode 85 = KP_Right KP_6 KP_Right KP_6 KP_Right KP_6 KP_Right KP_6
              keycode 87 = KP_End KP_1 KP_End KP_1 KP_End KP_1 KP_End KP_1
              keycode 88 = KP_Down KP_2 KP_Down KP_2 KP_Down KP_2 KP_Down KP_2
              keycode 89 = KP_Next KP_3 KP_Next KP_3 KP_Next KP_3 KP_Next KP_3
              keycode 90 = KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0
              keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal


              You may need to add xmodmap ~/.Xmodmap to your startup applications, I'm not sure if Xfce does this by default.



              Doing it this way has the advantage that most of the time, you won't have NumLock on. A few programs have trouble with NumLock because they consider it to be a modifier and that causes their keyboard shortcuts not to work when it's on.



              If you never turn off NumLock, you can disable the NumLock key while you're at it.



              keycode 77 = NoSymbol


              If you enjoy pain, you can use XKB instead. Here's my configuration which effectively makes NumLock always on. Create a file ~/.xkb/types/mytypes containing



              // Digits without NumLock, cursor with NumLock. Shift swaps the meaning.
              // Do it this way because I almost always want digits, but the NumLock state
              // breaks key bindings in some applications.
              partial xkb_types "invert_numlock" {
              type "KEYPAD" {
              modifiers = Shift+NumLock;
              map[None] = Level2;
              map[Shift] = Level1;
              map[NumLock] = Level1;
              map[Shift+NumLock] = Level2;
              level_name[Level1] = "Base";
              level_name[Level2] = "Number";
              };
              include "extra(keypad)"
              };


              Create a file ~/.xkb/symbols/mysymbols containing:



              partial xkb_symbols "mykeypad" {
              key <KP7> { [ KP_7, KP_Home ] };
              key <KP8> { [ KP_8, KP_Up ] };
              key <KP9> { [ KP_9, KP_Prior ] };
              key <KP4> { [ KP_4, KP_Left ] };
              key <KP5> { [ KP_5, KP_Begin ] };
              key <KP6> { [ KP_6, KP_Right ] };
              key <KP1> { [ KP_1, KP_End ] };
              key <KP2> { [ KP_2, KP_Down ] };
              key <KP3> { [ KP_3, KP_Next ] };
              key <KP0> { [ KP_0, KP_Insert ] };
              key <KPDL> { [ KP_Decimal, KP_Delete ] };
              };


              Run the following shell command as part of your X initialization startup (add other options to the setxkbmap call as desired):



              setxkbmap -types "complete+mytypes(invert_numlock)" 
              -symbols "us+compose(menu)+mysymbols(mykeypad)"
              -print | xkbcomp -I ~/.xkb - "$DISPLAY"





              share|improve this answer















              You can invert the meaning of Num Lock. With Xmodmap, put this in your .Xmodmap.



              keycode  79 = KP_Home KP_7 KP_Home KP_7 KP_Home KP_7 KP_Home KP_7
              keycode 80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8 KP_Up KP_8
              keycode 81 = KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9 KP_Prior KP_9
              keycode 83 = KP_Left KP_4 KP_Left KP_4 KP_Left KP_4 KP_Left KP_4
              keycode 84 = KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5 KP_Begin KP_5
              keycode 85 = KP_Right KP_6 KP_Right KP_6 KP_Right KP_6 KP_Right KP_6
              keycode 87 = KP_End KP_1 KP_End KP_1 KP_End KP_1 KP_End KP_1
              keycode 88 = KP_Down KP_2 KP_Down KP_2 KP_Down KP_2 KP_Down KP_2
              keycode 89 = KP_Next KP_3 KP_Next KP_3 KP_Next KP_3 KP_Next KP_3
              keycode 90 = KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0 KP_Insert KP_0
              keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal KP_Delete KP_Decimal


              You may need to add xmodmap ~/.Xmodmap to your startup applications, I'm not sure if Xfce does this by default.



              Doing it this way has the advantage that most of the time, you won't have NumLock on. A few programs have trouble with NumLock because they consider it to be a modifier and that causes their keyboard shortcuts not to work when it's on.



              If you never turn off NumLock, you can disable the NumLock key while you're at it.



              keycode 77 = NoSymbol


              If you enjoy pain, you can use XKB instead. Here's my configuration which effectively makes NumLock always on. Create a file ~/.xkb/types/mytypes containing



              // Digits without NumLock, cursor with NumLock. Shift swaps the meaning.
              // Do it this way because I almost always want digits, but the NumLock state
              // breaks key bindings in some applications.
              partial xkb_types "invert_numlock" {
              type "KEYPAD" {
              modifiers = Shift+NumLock;
              map[None] = Level2;
              map[Shift] = Level1;
              map[NumLock] = Level1;
              map[Shift+NumLock] = Level2;
              level_name[Level1] = "Base";
              level_name[Level2] = "Number";
              };
              include "extra(keypad)"
              };


              Create a file ~/.xkb/symbols/mysymbols containing:



              partial xkb_symbols "mykeypad" {
              key <KP7> { [ KP_7, KP_Home ] };
              key <KP8> { [ KP_8, KP_Up ] };
              key <KP9> { [ KP_9, KP_Prior ] };
              key <KP4> { [ KP_4, KP_Left ] };
              key <KP5> { [ KP_5, KP_Begin ] };
              key <KP6> { [ KP_6, KP_Right ] };
              key <KP1> { [ KP_1, KP_End ] };
              key <KP2> { [ KP_2, KP_Down ] };
              key <KP3> { [ KP_3, KP_Next ] };
              key <KP0> { [ KP_0, KP_Insert ] };
              key <KPDL> { [ KP_Decimal, KP_Delete ] };
              };


              Run the following shell command as part of your X initialization startup (add other options to the setxkbmap call as desired):



              setxkbmap -types "complete+mytypes(invert_numlock)" 
              -symbols "us+compose(menu)+mysymbols(mykeypad)"
              -print | xkbcomp -I ~/.xkb - "$DISPLAY"






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 16 '17 at 10:44

























              answered Jan 16 '17 at 0:00









              GillesGilles

              541k12810951611




              541k12810951611













              • I've created ~/.Xmodmap (correcting KPDelete on last line). I've set xmodmap ~/.Xmodmap to run at login. I've logged out and in again and even rebooted. When I run xmodmap ~/.Xmodmap in the terminal it does not return any error. The keys remap is not working for some reason. I wonder if there is a way I could remap using the /etc/default/keyboard file instead, perhaps the XKBOPTIONS. I use this file to swap my caps and escape keys for Vim. It is fine if it is a system-wide change. No one else uses my machine. Thanks

                – jbrock
                Jan 16 '17 at 0:50











              • @jbrock Strange. This comes directly from my configuration (I have numlock effectively always on), and I don't see why it wouldn't work everywhere (assuming you have a PC keyboard and a Linux installation from the last decade or so). You can do the same thing with XKB, but it's harder, there's no option for that, you have to build your own settings. I have code to do it though, I'll edit my answer.

                – Gilles
                Jan 16 '17 at 10:30













              • I tried the second solution (the one involving pain), but the setxkbmap command threw an error. I give up on the software solution. So, I just popped the key off and put a little black paint I had over the transparent part inside the key. Minor annoyance gone. Thanks for the thorough answer. You have my upvote. :)

                – jbrock
                Jan 17 '17 at 4:57











              • I also tried the first solution with a different keyboard, and it did not work with it either. It must be something strange with my system.

                – jbrock
                Jan 17 '17 at 4:59



















              • I've created ~/.Xmodmap (correcting KPDelete on last line). I've set xmodmap ~/.Xmodmap to run at login. I've logged out and in again and even rebooted. When I run xmodmap ~/.Xmodmap in the terminal it does not return any error. The keys remap is not working for some reason. I wonder if there is a way I could remap using the /etc/default/keyboard file instead, perhaps the XKBOPTIONS. I use this file to swap my caps and escape keys for Vim. It is fine if it is a system-wide change. No one else uses my machine. Thanks

                – jbrock
                Jan 16 '17 at 0:50











              • @jbrock Strange. This comes directly from my configuration (I have numlock effectively always on), and I don't see why it wouldn't work everywhere (assuming you have a PC keyboard and a Linux installation from the last decade or so). You can do the same thing with XKB, but it's harder, there's no option for that, you have to build your own settings. I have code to do it though, I'll edit my answer.

                – Gilles
                Jan 16 '17 at 10:30













              • I tried the second solution (the one involving pain), but the setxkbmap command threw an error. I give up on the software solution. So, I just popped the key off and put a little black paint I had over the transparent part inside the key. Minor annoyance gone. Thanks for the thorough answer. You have my upvote. :)

                – jbrock
                Jan 17 '17 at 4:57











              • I also tried the first solution with a different keyboard, and it did not work with it either. It must be something strange with my system.

                – jbrock
                Jan 17 '17 at 4:59

















              I've created ~/.Xmodmap (correcting KPDelete on last line). I've set xmodmap ~/.Xmodmap to run at login. I've logged out and in again and even rebooted. When I run xmodmap ~/.Xmodmap in the terminal it does not return any error. The keys remap is not working for some reason. I wonder if there is a way I could remap using the /etc/default/keyboard file instead, perhaps the XKBOPTIONS. I use this file to swap my caps and escape keys for Vim. It is fine if it is a system-wide change. No one else uses my machine. Thanks

              – jbrock
              Jan 16 '17 at 0:50





              I've created ~/.Xmodmap (correcting KPDelete on last line). I've set xmodmap ~/.Xmodmap to run at login. I've logged out and in again and even rebooted. When I run xmodmap ~/.Xmodmap in the terminal it does not return any error. The keys remap is not working for some reason. I wonder if there is a way I could remap using the /etc/default/keyboard file instead, perhaps the XKBOPTIONS. I use this file to swap my caps and escape keys for Vim. It is fine if it is a system-wide change. No one else uses my machine. Thanks

              – jbrock
              Jan 16 '17 at 0:50













              @jbrock Strange. This comes directly from my configuration (I have numlock effectively always on), and I don't see why it wouldn't work everywhere (assuming you have a PC keyboard and a Linux installation from the last decade or so). You can do the same thing with XKB, but it's harder, there's no option for that, you have to build your own settings. I have code to do it though, I'll edit my answer.

              – Gilles
              Jan 16 '17 at 10:30







              @jbrock Strange. This comes directly from my configuration (I have numlock effectively always on), and I don't see why it wouldn't work everywhere (assuming you have a PC keyboard and a Linux installation from the last decade or so). You can do the same thing with XKB, but it's harder, there's no option for that, you have to build your own settings. I have code to do it though, I'll edit my answer.

              – Gilles
              Jan 16 '17 at 10:30















              I tried the second solution (the one involving pain), but the setxkbmap command threw an error. I give up on the software solution. So, I just popped the key off and put a little black paint I had over the transparent part inside the key. Minor annoyance gone. Thanks for the thorough answer. You have my upvote. :)

              – jbrock
              Jan 17 '17 at 4:57





              I tried the second solution (the one involving pain), but the setxkbmap command threw an error. I give up on the software solution. So, I just popped the key off and put a little black paint I had over the transparent part inside the key. Minor annoyance gone. Thanks for the thorough answer. You have my upvote. :)

              – jbrock
              Jan 17 '17 at 4:57













              I also tried the first solution with a different keyboard, and it did not work with it either. It must be something strange with my system.

              – jbrock
              Jan 17 '17 at 4:59





              I also tried the first solution with a different keyboard, and it did not work with it either. It must be something strange with my system.

              – jbrock
              Jan 17 '17 at 4:59













              1














              You might be able to turn off the led in X11 each time you give the command



              xset -led named "Num Lock"


              or try explicit numbers like xset -led 3.






              share|improve this answer




























                1














                You might be able to turn off the led in X11 each time you give the command



                xset -led named "Num Lock"


                or try explicit numbers like xset -led 3.






                share|improve this answer


























                  1












                  1








                  1







                  You might be able to turn off the led in X11 each time you give the command



                  xset -led named "Num Lock"


                  or try explicit numbers like xset -led 3.






                  share|improve this answer













                  You might be able to turn off the led in X11 each time you give the command



                  xset -led named "Num Lock"


                  or try explicit numbers like xset -led 3.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 16 '17 at 10:28









                  meuhmeuh

                  32.3k12054




                  32.3k12054























                      0














                      If “num lock turned on by default” means “keys on the numpad by default” and you don’t want/don’t care about navigation on the keypad:



                      setxkbmap -option numpad:mac <layout>


                      So for the us layout:



                      setxkbmap -option numpad:mac us


                      Now the numpad always enters digits, no matter the num lock state.



                      Reference: xkeyboard-config man-page






                      share|improve this answer




























                        0














                        If “num lock turned on by default” means “keys on the numpad by default” and you don’t want/don’t care about navigation on the keypad:



                        setxkbmap -option numpad:mac <layout>


                        So for the us layout:



                        setxkbmap -option numpad:mac us


                        Now the numpad always enters digits, no matter the num lock state.



                        Reference: xkeyboard-config man-page






                        share|improve this answer


























                          0












                          0








                          0







                          If “num lock turned on by default” means “keys on the numpad by default” and you don’t want/don’t care about navigation on the keypad:



                          setxkbmap -option numpad:mac <layout>


                          So for the us layout:



                          setxkbmap -option numpad:mac us


                          Now the numpad always enters digits, no matter the num lock state.



                          Reference: xkeyboard-config man-page






                          share|improve this answer













                          If “num lock turned on by default” means “keys on the numpad by default” and you don’t want/don’t care about navigation on the keypad:



                          setxkbmap -option numpad:mac <layout>


                          So for the us layout:



                          setxkbmap -option numpad:mac us


                          Now the numpad always enters digits, no matter the num lock state.



                          Reference: xkeyboard-config man-page







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 3 hours ago









                          GuildensternGuildenstern

                          1386




                          1386






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f337647%2fdisable-num-lock-indicator-led-or-reverse-keypad-so-when-num-lock-is-on-indicat%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Accessing regular linux commands in Huawei's Dopra Linux

                              Can't connect RFCOMM socket: Host is down

                              Kernel panic - not syncing: Fatal Exception in Interrupt