Playing around with the lua interface to see what it can do. Defined the following hooks to see how it works:
add_to_hook("screen_workspace_switched",
function(frm, reg)
query_message(frm, "Switched WS to WRegion.name: " .. WRegion.name(reg))
end
)
add_to_hook("genframe_managed_switched",
function(frm, reg)
query_message(frm, "Switched Frame to WRegion.name: " .. WRegion.name(reg))
end
)
The first hook (for the people that doesn't know how hooks work in ion) provides the lua scripter with a callback whenever ion is switching workspace. Just like it says, "screen workspace switched". It means that whenever you swith workspace it gives the scripter the possabillity to intercept the call and do something at that time.
The other one is a callback for the occations when the user switches between frames. However, I'm not 100% sure what a "frame" in ion is. I'm using a tiled workspace, and as I understand it, everything in a tiled workspace is pretty much a frame. That means, that if I switch between tabs in the "same frame" I "switch" frames. It also means that if I swith between splits, I also "switch" frames. But that isn't how it works right now, it only gives me the call back when I switch between tabs. Is this a bug or am I missing something?
The idea here is to change the DEFUALT_MODIFIER key to something other than .. default, based on the title of the current frame. That would enable me to disable some short-cuts in favour of the application running in the frame instead (my Java IDE). And of course turn them on when I leave that frame.
Also: Hooks are great for prototyping new functionality in lua. I'd like more of them please. Also because doing "lenghty" operations in callback code is a BadThing(tm) I'd like to be able to exectute lua-code in a worker-thread, but ion needs to provide the thread for me.
Cheers, /Niclas -- Niclas Olofsson - http://www.ismobile.com Product Development, isMobile, Aurorum 2, S-977 75 Lule�, Sweden Phone: +46(0)920-75550 Mobile: +46(0)70-3726404
