On Sat, Jan 04, 2014 at 07:44:59PM -0800, noobermin wrote:
> 
> 
> On Friday, January 3, 2014 11:33:51 PM UTC-5, Tycho Andersen wrote:
> >
> > Hi, 
> >
> > On Thu, Jan 02, 2014 at 10:40:46PM -0800, noobermin wrote: 
> > > Hello all. 
> > > 
> > > I want to create a custom keybinding that opens a certain client based 
> > on 
> > > the active group. I'm confused where to begin. So if I give add Key() my 
> > > own CommandObject that does thing, 
> > > okay, but would the whole lazy.group thing work without changing 
> > LazyClass 
> > > itself? 
> > > 
> > > Yeah, as you can tell this is all a little fuzzy for me. Thanks for 
> > > suggestions. 
> >
> > How about: 
> >
> > def f(qtile): 
> >     if qtile.currentGroup == "foo": 
> >         subprocess.check_call("foo_script") 
> >     elif qtile.curentGroup == "bar": 
> >         subprocess.check_call("bar_script") 
> >
> > Key("mod3", "j", lazy.function(f)) 
> >
> > \t 
> >
> 
> Haven't tried it but it seems like that obviously would work. I didn't know 
> about lazy.function. Thanks a million sir. 

Sure thing. I guess there's a small typo, you need .name on
currentGroup:

    if qtile.currentGroup.name == "foo":
        ...


\t

-- 
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to