On Tue, Dec 08, 2020 at 03:43:58PM -0800, Nimble Clint wrote:
> Hello,
> 
> In my config.py I have the following function:
> 
> def window_to_next_screen(qtile): 
>     i = qtile.screens.index(qtile.current_screen) 
>     if i + 1 != len(qtile.screens): 
>         i = i + 1 
>     else: 
>         i = 0 
>     group = qtile.screens[i].group.name 
>     qtile.current_window.togroup(group)
> 
> Which is a slightly modified function from this config here. 
> <https://github.com/ramnes/qtile-config/blob/master/config.py#L57> 
> Essentially this function moves a window to a different screen. In 
> addition, I would like this function to also move focus to the window which 
> was just moved, but I'm a bit stumped on how to do that. One thing I tried 
> was this:
> 
> def window_to_next_screen(qtile): 
>     i = qtile.screens.index(qtile.current_screen) 
>     window = qtile.current_screen
>     if i + 1 != len(qtile.screens): 
>         i = i + 1 
>     else: 
>         i = 0 
>     group = qtile.screens[i].group.name 
>     qtile.current_window.togroup(group)
>     window.group.focus()

try qtile.focus_screen(i) here instead, I think that'll do it. You're
confusing the nomenclature a bit by calling this thing "window"
instead of "screen".

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/20201209133357.GA375305%40cisco.

Reply via email to