ion-devel rocks me sideways
#tags ion
I finally got off my lazy ass and learned to do kludge and lua stuff for ion-devel. I'm *so* glad I did.
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.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"
}
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!