I'm using something slightly more complicated: a C module that uses XCB to query for the status of caps lock and num lock, and then a Lua module so it's easier to integrate in my rc.lua.
The C module is here: https://github.com/Schnouki/dotfiles/tree/master/awesome/lousy (needs Swig), the Lua module is here: https://github.com/Schnouki/dotfiles/blob/master/awesome/locksmon.lua, and finally my rc.lua is here: https://github.com/Schnouki/dotfiles/blob/master/awesome/rc.lua (look for "locksmon"). It's not perfect (if you press your caps lock / num lock for more than 0.1 second before releasing it, the change won't be displayed correctly -- tweakable in locksmon.lua), but I like it as it avoids spawning a new process just to check for the keyboard status. Cheers, Thomas Le 2 octobre 2013 à 09:16 CEST, Massimiliano Brocchini a écrit : > Hi Dariusz, > > you can check my Caps Lock notification in > http://code.google.com/p/max-repo/source/browse/trunk/awesome/rc.lua > (search for "caps") > > and you can apply the same logic to Num Lock > > Pay attention that you may also want to intercept Shift + Caps Lock > > -- > Massi > > > On Wed, Oct 2, 2013 at 12:20 AM, Dariusz Luksza > <dariusz.luk...@gmail.com>wrote: > >> I've just ordered new laptop, unfortunately during my research about this >> model I miss tiny little thing. The keyboard doesn't have caps lock and num >> lock led indicators. >> >> My was idea is to write piece of lua code that will detect num lock and >> caps lock state changed event and pop up notification in top right corner. >> But maybe someone on the list had similar problem and already have working >> solution? >> >> If not, could give me some hints how I can listen for caps/num lock change >> event in lua.rc? >> >> >> -- >> Best regards >> >> Twitter: @dluksza >> GSM: +49 017 445 41235 >> Blog: http://luksza.org >> LinkedIn: >> http://www.linkedin.com/in/**dariuszluksza<http://www.linkedin.com/in/dariuszluksza> >> >> -- >> To unsubscribe, send mail to >> awesome-unsubscribe@naquadah.**org<awesome-unsubscr...@naquadah.org> >> . >> -- Thomas/Schnouki
pgpXUgHCj6702.pgp
Description: PGP signature