Re: send-to-workspace and go there



On Thu, Oct 21, 2004 at 01:21:35AM -0200, Mario Domenech Goulart wrote:

> Hi,
> 
> On 20 Oct 2004 14:30:32 -0700 Kin Cho <kcho fabric7 com> wrote:
> 
> > I want to bind keys make a window goto a workspace and also
> > select that workspace.  The following doesn't work for me:
> >
> > (bind-keys
> >  window-keymap
> >  "M-F1" (lambda () (send-to-workspace 1) (select-workspace 0))
> >  "M-F2" (lambda () (send-to-workspace 2) (select-workspace 1))
> >
> > Any idea why?
> 
> The send-to-workspace function doesn't seem to be exported by the
> sawfish.wm.workspace structure (just checked out from CVS).  Is it
> intentional?  The same happens with copy-to-workspace, as far as I could
> see.
> 
> Exporting send-to-workspace from sawfish.wm.workspace seem to make it
> work.

There is a send-window-to-workspace-from-first function that _is_ exported,
which takes as a parameter the window to send, so you could do

(bind-keys
  window-keymap
  "M-F1" (lambda () (send-window-to-workspace-from-first (input-focus) 0)
                    (select-workspace-from-first 0))
  "M-F2" (lambda () (send-window-to-workspace-from-first (input-focus) 1)
                    (select-workspace-from-first 1)))

I have changed select-workspace to select-workspace-from-first since this
should make it consistent with the "send-window" call.

To tidy this up, try

(define (send-to-and-select-workspace n)
  (send-window-to-workspace-from-first (input-focus) n)
  (select-workspace-from-first n)
  )

(bind-keys
  window-keymap
  "M-F1" '(send-to-and-select-workspace 0)
  "M-F2" '(send-to-and-select-workspace 1)
  )


HTH,

Ewan.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]