[UP] add many more ion3 cfg -_-, powerfull, and add thinkpad xorg.conf/.Xmodmap,...
[arrow.git] / archlinux_conf / etc / ion3 / zoom.lua
blobeacbf976a03ae65c1f9cc71a211c582c1545a2f1
1 -- zoom.lua
2 --
3 -- exchanges current client window with the active client window of the frame
4 -- called 'zoomframe' -- resembling the behavior of larswm
5 --
6 -- +---------------------------------------------------+-----------------+
7 -- | | |
8 -- | | |
9 -- | | |
10 -- | | Client 1 |
11 -- | | |
12 -- | | |
13 -- | Z o o m f r a m e w i t h +-----------------+
14 -- | z o o m e d C l i e nt | |
15 -- | | |
16 -- | | Client 2 |
17 -- | | |
18 -- | | |
19 -- | | |
20 -- +--------------------------------+------------------+-----------------+
21 -- | | |
22 -- | | |
23 -- | Client 4 | Client 3 |
24 -- | | |
25 -- | | |
26 -- +--------------------------------+------------------------------------+
28 -- Example: zoom_client on "Client 2" will put "Client 2" into the zoom frame
29 -- and "zoomed Client" into the frame of "Client 2"
31 -- By Rene van Bevern <rvb@pro-linux.de>, 2005
32 -- Modifications by Etan Reisner <deryni in #ion>
33 -- Public Domain
35 -- Example keybindings:
37 -- defbindings("WFrame", {
38 -- kpress(META.."z", "zoom_client(_, _sub)")
39 -- kpress(META.."z", "zoom_client(_, _sub, {swap=true})")
40 -- kpress(META.."z", "zoom_client(_, _sub, {swap=false, goto=true})")
41 -- }
43 -- zoom_client accepts a table that may contain the options 'swap'
44 -- and 'goto'. Both are by default set to 'true'.
46 -- 'goto' controls whether to switch to the zoomframe
48 -- 'swap' controls whether to bring the zoomframe's active client
49 -- into the current frame
52 -- Example configuration setup:
54 -- zoom_client_set({zoomframename = 'foo'})
56 local settings = {
57 zoomframename = 'zoomframe'
60 function zoom_client_set(tab)
61 settings = table.join(tab, settings)
62 end
64 function zoom_client(curframe, curclient, options)
65 local zoomframe = ioncore.lookup_region(settings.zoomframename, 'WFrame')
66 if options == nil then
67 options = {}
68 end
69 if options.goto == nil then
70 options.goto = true
71 end
72 if options.swap == nil then
73 options.swap = true
74 end
75 if (not zoomframe) or (curframe == zoomframe) then
76 return
77 end
78 local zoomclient = zoomframe:lcurrent(1)
79 if curclient then
80 zoomframe:attach(curclient)
81 end
82 if zoomclient and options.swap then
83 curframe:attach(zoomclient)
84 end
85 if zoomclient and options.goto then
86 zoomclient:goto() -- make it activated in the frame
87 end
88 if curclient and options.goto then
89 curclient:goto()
90 end
91 end