Jdrrant

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 20 October 2012

numlock on kde under gentoo linux

Posted on 10:34 by Unknown
I find it very annoying that linux seems to have no uniform way to just turn the numlock on when the system comes on and leave it that way. Every minor change of environment resets the numlock back to off, which I can't really imagine anyone actually wanting. Well, maybe people without numeric keypads where the numlock steals part of their keyboard, but for the majority of people who have a standard ANSI 104 key keyboard, I would think you'd want the numlock on by default. Windows understands this, so why doesn't linux?

I use KDE, and there is a setting in KDE that lets you turn the numlock on when you login. However, it doesn't work for all situations. For some reason, the console is a separate environment from the X server (running KDM) which is a separate environment from KDE, and each one has an individual numlock state.

The console is a minor annoyance for me, since I rarely use it, but it's the easiest one to fix so we'll start here. To turn numlock on for your console, simply add the numlock init.d script to your default rc script. e.g. "rc-update add numlock default". When you reboot, numlock will be on by default for the console.

The second enviroment, KDM (the KDE Display Manager) requires a change to the kdmrc file. For some reason, gentoo puts this file in /usr/share/config/kdm rather than somewhere in /etc like I would expect. I know they put it somewhere else on Kubuntu, so if you don't use gentoo, you'll have to find the kdmrc file yourself. Edit this file and look for the line NumLock=Off and change it to NumLock=On and uncomment the line. The next time KDM is started, numlock will be enabled.

The third environment, KDE, requires a change in the Keyboard settings. Go to Settings, Hardware, Input Devices, Keyboard and change Numlock on KDE Startup to to Turn on.

There was a fourth hidden environment for me, which occurs because I use gentoo keychain run from .bash_profile using the x11-ssh-askpass (just ssh-askpass on Ubuntu, btw). So my .bash_profile has some lines like this in it:

export SSH_ASKPASS="/usr/bin/x11-ssh-askpass"
keychain ~/.ssh/id_rsa

So after logging in with KDM (where the numlock was on), numlock would go back to being off before KDE would put it back on with the settings, so x11-ssh-askpass would require me to turn numlock on AGAIN. We can counter this by using numlockx. You can install it using "emerge numlockx" as root. Then we can change the .bash_profile to use numlockx before running keychain.

export SSH_ASKPASS="/usr/bin/x11-ssh-askpass"

if [ x$DISPLAY != x ]; then
        numlockx
fi

keychain ~/.ssh/id_rsa

Finally, I never have to turn on numlock when I'm logging in.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in gentoo, kde, kdm, keychain, Linux, numlock, numlockx, ssh-askpass, x11-ssh-askpass | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • TiVo Serial Null-Modem Networking on Windows Vista and 7
    The original series 1 TiVo used a built-in modem to connect to the internet to download program guide and channel listings. A few years ago,...
  • SSH is a versatile tool
    I had no idea SSH was so versatile. I moved to a new apartment a few months back. It comes with shared internet service for the complex. The...
  • Hackintosh Lion Triple Boot with Windows 7 and Linux
    My hard drive recently failed and took out all my operating systems. After replacing the drive, I spent a week figuring out how to get all t...
  • ImgBurn on Linux
    I've seen this covered in other places, but it never worked for me until today, so I thought I'd share my solution. First off, why w...
  • Snow Leopard 10.6.8 on VirtualBox 4 with Sandy Bridge
    Edit: 2013-May-23 -- This doesn't seem to work with new versions of VirtualBox. VirtualBox 4.1.24 seems to be the last version where thi...
  • numlock on kde under gentoo linux
    I find it very annoying that linux seems to have no uniform way to just turn the numlock on when the system comes on and leave it that way. ...
  • DVDFabHDDecrypter on Linux
    It's not too difficult to setup DVDFab under Linux using Wine, but there are a couple caveats. It seems the settings cannot be modified ...
  • Comcast, It's FRAUDtastic!
    There are plenty of stories about Comcast and their terrible customer service. It doesn't seem to faze them, but you never know. A small...
  • attempt to access beyond end of device
    I ran across this error the other day and couldn't figure out what it meant. For starters, it was talking about a partition that wasn...
  • Why Does Anyone Use OpenSolaris?
    I was trying to help someone on the filezilla forums who uses OpenSolaris . They weren't too familiar with how to compile their own bin...

Categories

  • 10.4
  • 10.6
  • 10.6.8
  • Advanced Format
  • binary
  • Burning
  • CD
  • Chameleon
  • Chimera
  • Comcast
  • core i5
  • dbus
  • dmesg
  • DNS
  • DOCSIS
  • dslreports
  • DVD
  • dvdauthor
  • DVDAuthorGUI
  • DVDFab
  • end of device
  • FileZilla
  • frontend
  • gentoo
  • gettext
  • GNU
  • gptfdisk
  • hackintosh
  • hibernation
  • iBoot
  • ImgBurn
  • Internet
  • kde
  • kdm
  • keychain
  • lCstd
  • ld
  • Linux
  • Lion
  • Mac
  • make
  • modem
  • Mountain Lion
  • msgmerge
  • MultiBeast
  • numlock
  • numlockx
  • OpenSolaris
  • OSX
  • proxy
  • qSimpleDvd
  • resume
  • reverse
  • ripping
  • Sandy Bridge
  • Snow Leopard
  • SOCKS5
  • speedtest
  • SSH
  • ssh-askpass
  • suspend
  • swap
  • Tiger
  • tunnel
  • VirtualBox
  • Windows
  • Wine
  • x11-ssh-askpass

Blog Archive

  • ►  2013 (1)
    • ►  September (1)
  • ▼  2012 (2)
    • ▼  October (1)
      • numlock on kde under gentoo linux
    • ►  May (1)
  • ►  2010 (2)
    • ►  October (1)
    • ►  January (1)
  • ►  2009 (7)
    • ►  March (2)
    • ►  January (5)
Powered by Blogger.

About Me

Unknown
View my complete profile