With the new lua5 usage in ion-devel, you can basically script anything in key bindings. Using different means, I wrote two keybindings that let me view and rename frame region names (the physical frames themselves, not the deskspace name or the program name).
kpress(DEFAULT_MOD.."F10", function(reg)
query_query(reg, "rename: ", nil, function(msg)
query_message(reg,"Set current region name to: "..msg)
region_set_name(reg,msg)
end,nil)
end),
press("F10", function(reg)
query_message(reg, "name: " .. region_name(reg))
end),
These bindings were added to mplex_bindings.Using nested, anonymous functions, we acheive our goals. Hitting "F10" in ion will now print the name of the currently-focused frame. ALT+F10 will prompt you to change it's name. Neat, eh?
I also did a bunch of kludge stuff for gaim, mozilla (firebird, really, but it'll work for mozilla), and gimp. Gimp required a bit of work telling what windows to go where since there are quite a few windows that can pop up.
So how do I do this kludge nonsense?
You'll need a tool that comes standard with XFree86, xprop This tool allows you to identify the class and instance of a given window. Simply type this command in a shell:
xprop WM_CLASS
The cursor will now turn into a crosshairs and you will need to click on the window you want to discover. For instance, clicking on one of my xterms produces this output:
WM_CLASS(STRING) = "xterm", "XTerm"
Now, the first word "xterm" is the instance. "XTerm" is the class. Now to make this a working kludge that'll send any programs matching this to a specific frame, you need to write a valid winprop entry.
winprop {
class = "XTerm"
instance = "xterm"
target = "target_frame"
}
We'll need a frame called 'target_frame' for this to work, so using the ALT+F10 keybinding from above, we can name a given frame. Restart ion with the F11 key (unless you've rebound that) and your kludge will now work. Run an xterm from anywhere in ion, and it'll be placed inside that frame.
In the screenshot on the right, you can see gimp in the works. All of those windows were placed in their own frames automatically, without me having to move a single one of them!