{"id":73,"date":"2006-04-26T14:09:19","date_gmt":"2006-04-26T06:09:19","guid":{"rendered":"http:\/\/yesybl.org\/blogcn\/2006\/04\/26\/73\/"},"modified":"2006-04-26T14:09:19","modified_gmt":"2006-04-26T06:09:19","slug":"how-to-set-the-numlock-on-as-the-default-in-x-startup-2","status":"publish","type":"post","link":"https:\/\/www.yesybl.com\/?p=73","title":{"rendered":"How to set the numlock on as the default in X startup."},"content":{"rendered":"<p>Method 1:<\/p>\n<p>apt-get install numlockx<\/p>\n<p>gedit \/etc\/X11\/gdm\/Init\/Default<br \/>\u641c\u5bfb\u8fd9\u4e00\u884c\u6587\u5b57<br \/>&#8230;<br \/>exit 0<\/p>\n<p>\u5728\u8fd9\u4e4b\u524d\u65b0\u589e\u4e0b\u9762\u51e0\u884c\u6587\u5b57<br \/>if [ -x \/usr\/bin\/numlockx ];<br \/>&#160; then \/usr\/bin\/numlockx on<br \/>fi<br \/>\u4fdd\u5b58\u7f16\u8f91\u8fc7\u7684\u6587\u4ef6<\/p>\n<p>Method 2:<\/p>\n<p>&#160;How to Set Num Lock ON as the default in X startup<\/p>\n<p>This applies to people who want to override the Linux kernel default of turning<br \/>the Num Lock key off at boot time -&gt;(so their Desktops start up with the Num<br \/>Lock key ON when they log in).<\/p>\n<p>If you rarely or never use the number keypad, it really is an insignificant<br \/>problem since all you have to do is press the Num Lock key after logging in to<br \/>turn it on.<\/p>\n<p>However, if you are an accountant or bookkeeper (or you provide support on a<br \/>network for these kinds of users) you would probably like to have the Num Lock<br \/>key turned on automatically. It is annoying for data entry people to start<br \/>typing and look up to see that they are not even in the field they thought they<br \/>were (keypad is in &quot;arrows and paging\/home and end&quot; mode).<\/p>\n<p>For those of you who would like to fix this problem, here are two reliable<br \/>solutions; chose the one appropriate to your desktop. The fix for the Gnome<br \/>desktop should work equally well for others, but I haven&#8217;t tried it.<\/p>\n<p>++++++++++++++++++++++++ KDE DESKTOP ++++++++++++++++++++++++<\/p>\n<p>If you use the KDE desktop:<br \/>1. Go to the Start button:<br \/>&#8211;&gt; Control Center &#8211;&gt; Preferences &#8211;&gt; Peripherals &#8211;&gt; Keyboard<br \/>2. Check the radio button for &quot;Num Lock On&quot; at KDE startup.<br \/>*note: for some versions of KDE you have to click an Advanced tab.<br \/>3. Log out and Log back in (to restart the X environment)<br \/>&#8230;you&#8217;re done. If you use the Gnome desktop, it&#8217;s slightly more difficult. If<br \/>the Num Lock key being on at startup is important to you, two options are to<br \/>follow the below instructions OR switch desktops.<\/p>\n<p>++++++++++++++++++++++++ GNOME DESKTOP ++++++++++++++++++++++++<\/p>\n<p>To switch desktops from Gnome to KDE click on the start button and then:<\/p>\n<p>System Tools &#8211;&gt; More System Tools &#8211;&gt; Desktop Switching Tool<br \/>Choose the KDE button<br \/>Log Out and Log back in (to restart X server)<br \/>Follow the instructions above for the KDE desktop.<\/p>\n<p>============ Below this line is the fix for Gnome desktop ===========<\/p>\n<p>NOTE 1: To successfully do this you need the C compiler (series d, package gcc)<br \/>and the include files of the X libraries(package xdevel, series x).<\/p>\n<p>If you don&#8217;t have the gcc (Gnu Compiler Collection) which includes the C<br \/>compiler,<br \/>you should install it. You can fix LOTS of problems with these very valuable<br \/>tools<br \/>(without a lot of programming knowledge).<\/p>\n<p>If you DO NOT have the C compiler, and you DO NOT WANT the gcc package on your<br \/>machine,<br \/>I am told you can use the &quot;setleds +num &amp;&gt; \/dev\/null&quot; command in one of the X<br \/>start-up<br \/>scripts. I don&#8217;t know if this method works or not, but it probably will take<br \/>more<br \/>tinkering on your part (unless you really know your scripting).<\/p>\n<p>NOTE: For those of you *who boot to run level 3*, you can add &quot;setleds +num &amp;&gt;<br \/>\/dev\/null&quot;<br \/>(which null routes any error output) to the end of .bashrc but you must specify<br \/>the<br \/>&quot;&amp;&gt; \/dev\/null&quot;, NOT just &quot;setleds +num&quot;. Otherwise, you will get an error<br \/>message every<br \/>time you start a terminal from your desktop. Note that &quot;setleds +num&quot; doesn&#8217;t<br \/>work from<br \/>a virtual console (terminal) anyway; it&#8217;s NOT quite the same as the console.<\/p>\n<p>&gt;&gt;&#8211;&gt;This will turn Num Locks on when you log in to the console, but NOT when<br \/>you run startx.<\/p>\n<p>END NOTE 1<\/p>\n<p>&gt;&gt;&#8211;&gt;best to perform this procedure as root.<\/p>\n<p>When you have gcc as explained above:<\/p>\n<p>1. Download this very small program: setnumlock.tar.gz<br \/>a) here is the link &#8211;&gt; ftp:\/\/ftp.silug.org\/pub\/ltsp\/setnumlock.tar.gz<br \/>NOTE: I tested on Redhat 8\/9 (probably works on other distributions too)<\/p>\n<p>b) I suggest you create a directory named num-on to download the file to.<br \/>type command: mkdir num-on<\/p>\n<p>c) When you have finished the download:<br \/>cd (change directory) to num-on (or wherever you downloaded the file)<br \/>gzip -d setnumlock.tar.gz<br \/>tar xvf setnumlock.tar<br \/>cd setnumlock<br \/>type &quot;make&quot;<br \/>then type &quot;make install&quot;<\/p>\n<p>Make install has now created \/usr\/bin\/setnumlock<br \/>(a very small program that turns numlock on)<\/p>\n<p>2. Now you need to run this program whenever you log in:<br \/>Click the start button and go to:<br \/>&#8211;&gt; Preferences &#8211;&gt; More Preferences &#8211;&gt; Session<br \/>Click the Start Up Programs tab.<br \/>Click the Add button.<br \/>Browse to \/usr\/bin\/setnumlock (or type in \/usr\/bin\/setnumlock)<br \/>Click OK.<br \/>Logout and Log back in (to restart the X server)<\/p>\n<p>If you are wondering why such a simple option is missing, there is apparently a<br \/>problem with the keyboard options on the Gnome desktop which was not resolved<br \/>at the time of this writing, ie. after pressing the Num Lock key sometimes the<br \/>keyboard loses some or all functionality. Hasn&#8217;t happened to me, but it has to<br \/>quite a few other people.<\/p>\n<p>**For this reason, Gnome developers have omitted the &quot;Num Locks On at Startup&quot;<br \/>option for peripheral setup under keyboard. I&#8217;m guessing this will probably be<br \/>fixed by the next release.<\/p>\n<p>There was a patch on the Gnome site, but it seems to have disappeared; I fixed<br \/>mine as above and don&#8217;t know if the patch is appropriate. Some of the<br \/>developers at Gnome feel this problem is too insignificant to warrant their<br \/>attention and prefer that it not be mentioned again; for SURE they are very<br \/>busy with more important issues so it&#8217;s understandable.<\/p>\n<p>Nuff said. Hope this helps someone,<\/p>\n<p>J.May<\/p>\n","protected":false},"excerpt":{"rendered":"<a href=\"https:\/\/www.yesybl.com\/?p=73\" rel=\"bookmark\" title=\"Permalink to How to set the numlock on as the default in X startup.\"><p>Method 1: apt-get install numlockx gedit \/etc\/X11\/gdm\/Init\/Default\u641c\u5bfb\u8fd9\u4e00\u884c\u6587\u5b57&#8230;exit 0 \u5728\u8fd9\u4e4b\u524d\u65b0\u589e\u4e0b\u9762\u51e0\u884c\u6587\u5b57if [ -x \/usr\/bin\/numlockx ];&#160; then \/usr\/bin\/numlockx onfi\u4fdd\u5b58\u7f16\u8f91\u8fc7\u7684\u6587\u4ef6 Method 2: &#160;How to Set Num Lock ON as the default in X startup This applies to people who want to override the Linux kernel default of turningthe Num Lock key off at boot time -&gt;(so their Desktops start [&hellip;]<\/p>\n<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pa4z28-1b","_links":{"self":[{"href":"https:\/\/www.yesybl.com\/index.php?rest_route=\/wp\/v2\/posts\/73"}],"collection":[{"href":"https:\/\/www.yesybl.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yesybl.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yesybl.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yesybl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=73"}],"version-history":[{"count":0,"href":"https:\/\/www.yesybl.com\/index.php?rest_route=\/wp\/v2\/posts\/73\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yesybl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yesybl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yesybl.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}