-- $Id: xsteve-functions.lua 83 2004-02-19 08:27:00Z reichr $ -- from Tom Payne function ionws_move_current(frame, dir) local ws = frame while ws and not obj_is(ws, "WIonWS") do ws = ws:manager() end if not ws then return end local c = frame:current() local other = nil if dir == "left" then other = ws:left_of(frame) or ws:rightmost() elseif dir == "right" then other = ws:right_of(frame) or ws:leftmost() elseif dir == "up" then other = ws:above(frame) or ws:lowest() elseif dir == "down" then other = ws:below(frame) or ws:topmost() else return end if c and obj_is(other, "WMPlex") then other:attach(c, { switchto = true }) end if other then other:goto() end end ionframe_bindings{ kpress(DEFAULT_MOD.."Control+H", function(frame) ionws_move_current(frame, "left") end), kpress(DEFAULT_MOD.."Control+J", function(frame) ionws_move_current(frame, "down") end), kpress(DEFAULT_MOD.."Control+K", function(frame) ionws_move_current(frame, "up") end), kpress(DEFAULT_MOD.."Control+L", function(frame) ionws_move_current(frame, "right") end), } -------------------------------------------------------------------------------- -- Move all windows on a WIonWS to a single frame and destroy the rest. -- taken from http://www-verimag.imag.fr/~moy/ion/collapse.lua collapse={} function collapse.move_managed(tgt, src) local l=src:managed_list() for _, m in l do tgt:attach(m) end end -- Improvement by Matthieu MOY : initializes tgt to ws:current(). -- The current frame becomes the unique frame of this workspace. function collapse.collapse(ws) local l=ws:managed_list() local tgt=ws:current() -- This was not initialized. for _, f in l do if obj_is(f, "WIonFrame") then if tgt ~= f then -- This has changed also. collapse.move_managed(tgt, f) f:close() end end end end -------------------------------------------------------------------------------- -- 10.10.2003 function add_winprops(framename,proptable) -- print("Adding winprops for: "..framename) for i,v in ipairs(proptable) do -- print(i..": class: "..v[2]..", instance: "..v[1]) -- v[3] is optional and means the name if table.getn(v) == 3 then name = v[3] else name = None end winprop{ class = v[2], instance = v[1], name = name, target = framename } end end -- 19.02.2004 function ionws_goto_direction(frame, dir) local ws = frame while ws and not obj_is(ws, "WIonWS") do ws = ws:manager() end if not ws then return end local c = frame:current() local other = nil if dir == "left" then other = ws:left_of(frame) or ws:rightmost() elseif dir == "right" then other = ws:right_of(frame) or ws:leftmost() elseif dir == "up" then other = ws:above(frame) or ws:lowest() elseif dir == "down" then other = ws:below(frame) or ws:topmost() else return end if other then other:goto() end end -------------------------------------------------------------------------------- function x_lf() include "xsteve-functions.lua" end function x_load_config() include "ion-xsteve.lua" end -- some tests -- function x_data(str) -- print(string.format("x_data: %s", str)) -- return "blups" -- end -- -- function x_ph() -- print("hurz\n") -- -- s = rootwin_current_scr( -- screen = find_screen_id(0) -- -> WScreen object -- -- print (string.format"actual screen name: %s",region_name(screen)) -- -- managed region by the screen, usually a workspace or a fullscreen client window -- ws = screen_current(screen) -- -- -- only useful for ionws workspaces, returns the frames on the workspace -- ml = ionws_managed_list(ws) -- print(ml) -- for d,x in ml do -- print(d,x) -- end -- -- -- actreg = ionws_current(ws) -- -- query_message(actreg,"hello") -- -- --print (string.format"actual region name: %s",region_name(actreg)) -- print (actreg) -- cws = complete_clientwin("") -- print("Client wins:\n") -- for d,x in cws do -- print(d,x) -- end -- -- end global_bindings{ kpress(DEFAULT_MOD.."F10", x_lf), } -- arch-tag: 40a41b9b-7876-452c-8679-5c5f96194d62