Welp, unfortunately screen_change never worked for me. However, I did
finally get the functionality I wanted to work by simply setting a global
boolean in my settings.py anytime the keybinding for a window was pressed
and that Dropdown hadn't already been toggled before. It works pretty well
now. Now if I can just get spotify to work I'll be all set! I'll have to
make a different topic for that one if I can't get it, though.
Thanks much for the help!
On Tuesday, June 11, 2019 at 4:28:01 PM UTC-4, Tycho Andersen wrote:
>
> On Tue, Jun 11, 2019 at 12:58:45PM -0700, Aaron Helton wrote:
> > As far as a scratchpad.py goes, I do not have that file. My scratchpad
> is
> > set up in my groups.py file, and is simply declared as such:
> > groups = [
> > Group("Development"),
> > ... (Other Groups),
> > ScratchPad("scratchpad", [
> > DropDown("browser", "qutebrowser -R --basedir
> > ~/.config/scratchpad_qutebrowser/",
> > on_focus_lost_hide=False, x=0.05, y=0.05,
> > width=0.9, height=0.9),
> > ... (Other similar DropDowns)
> > ]),
> > ]
> >
> > As for what I meant regarding the scratchpad being called to, what I
> meant
> > was that I was confused that the client isn't first being assigned to
> the
> > 'scratchpad' group, then re-assigned to the current group.It's instead
> > being directly assigned to the group I want the DropDown to appear on.
> That
> > does make some sense when I think about it, I was just confirming that
> that
> > is indeed what it supposed to happen.
> >
> > Regarding the group_window_add hook, I see that it doesn't appear to
> pass
> > any arguments. What would be the best way to get the window that was
> just
> > added when it's called?
>
> I think this is a bug that we should fix:
> https://github.com/qtile/qtile/pull/1341
>
> > Really, I just need any way to identify when a new window is created
> that
> > is part of the Scratchpad group,
>
> I think you don't want to deal with the IPC stuff (i.e. lazy.*) at
> all, then:
>
> @hook.subscribe.screen_change
> def on_manage(w):
> if w.group.name == 'scratchpad':
> w.on_scratchpad = True # bit of a hack to write to our objects,
> but c'est la vie
>
> def kill_window(qtile):
> if qtile.currentWindow.on_scratchpad:
> qtile.currentWindow.togroup('scratchpad')
> else:
> qtile.currentWindow.kill()
>
> Key([mod], "k", lazy.function(kill_window)),
>
> > and I was hoping to do it without relying
> > on how the internals of the groups work, since I wanted to future-proof
> it
> > in case a change is made in the future.
>
> Unfortunately, we don't really consider anything that interacts with
> the qtile object as a stable API. If you wanted to build some kind of
> scratchpad functionality into the core, that would be more reliable.
>
> Stuff like this doesn't change very much, but it does on occasion.
>
> Tycho
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/qtile-dev/802941d3-1387-46c0-ab28-e2c059a971b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.