On Wed, Aug 20, 2003 at 09:35:08PM +0300, Tuomo Valkonen wrote:
> function move_left(ws, frame)
>     local c, other = frame:current(), ws:left_of(frame)
>     if c and obj_is(other, "WMPlex") then
>         other:attach(c, { switchto = true })
>     end
>     if other then
>         other:goto()
>     end
> end
> 
> That should do it, but I haven't tried it.

Great, thanks. I had to calculate the ws variable thus:

ionframe_bindings{
    kpress(DEFAULT_MOD.."Control+H", function(frame)
        -- Calculate ws
        ws = frame
        while ws and not obj_is(ws, "WIonWS") do
            ws = ws:manager()
        end
        if not ws then return end
        -- Calc done
        local c, other = frame:current(), (ws:left_of(frame) or ws:rightmost(frame))
        if c and obj_is(other, "WMPlex") then
            other:attach(c, { switchto = true })
        end
        if other then
            other:goto()
        end
        end),
}

Is there a shortcut or better way of find the workspace that the frame is
on?

Cheers,

Tom

Reply via email to