View Single Post
Old 09-11-2012, 02:22 PM   #20
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677485
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by eureka View Post
Well, it could be changed without major changes, but it will possibly require knowledge of Lua. Though, Lua is easy language (yes, really).

Home button action is defined in /etc/xdg/awesome/rc.lua in function handleHomeKeyUp (there is also small partner function handleHomeKeyDown). At the end of function, there is following chunk of code:
Code:
-- launch the default app                                   
log("==============Sending Home Button")                    
logTimeStamp("home button press")                           
client.validate_stacking_order()                            
lipcH:set_int_property("com.lab126.appmgrd", "startdefault", 0)
So, that's how it works.

lipcH is a top-scope variable (defined in rc.lua) with handle for working with LIPC. In fact, one could not only set any external property through it, but also register new property for provider com.lab126.winmgr and change value of this new property appropriately. And even subscribe to LIPC events. Or send such events. For examples and insights:
Spoiler:
Code:
grep -r lipcH /etc/xdg/awesome
Code:
strings /usr/lib/lua/liblipclua.so

So, with the help of LIPC one can transimt status of Home button from rc.lua to outside world. Or just read it's state from some other source (physical Home key is mapped as keyboard Home key).

Sorry if it sounded like a crude refutation, I just wanted to help a little.
Yep, I knew about most of this (not about the LIPC part though, thanks for pointing that out).

I had already thought about posting a LIPC event on button press... then of course any software interested in it (that would include at least the home & reader booklets) would have to be changed to listen for these events, and to act accordingly.

But this is what I consider to be a "major" change
ixtab is offline   Reply With Quote