It did not work, and tried to pass lazy object to use it inside inner class. this is my config file https://github.com/STR4NG3R/my-setup-arch/blob/master/installation_folder/qtile/qtile/config.py
El miércoles, 13 de enero de 2021 a las 4:04:26 UTC-6, Guillaume Gelin escribió: > What you did should work, I think it's just the keybinding that's wrong. > You should use switch_screen (that will return the inner lazy function), > not lazy.function, i.e.: Key([mod, "mod1"], "h", switch_screen(-1)) > > > Le mer. 13 janv. 2021 à 09:16, Pablo Eduardo Martínez <[email protected]> > a écrit : > >> Currently i move to Screens with Super+alt+h (previous) and Super+alt+l >> (next). >> >> Key([mod, "mod1"], "h", lazy.to_screen(0)), >> Key([mod, "mod1"], "l", lazy.to_screen(1)), >> >> it works ok, but i want to do it dinamically, but i dont know how to call >> a lazy spawn from qtile arg and how to call lazy.to_screen(current_screen), >> or i can pass a lazy object on the primary function? >> >> something like this >> def switch_screen(index): >> @lazy.function >> def __inner(qtile): >> global current_screen, max_screens >> current_screen += index >> if current_screen > 0 and current_screen < monitors: >> qtile.to_screen(current_screen) >> qtile.spawn(f'notify-send "Move to Screen {current_screen}"') >> else: >> current_screen -= index >> qtile.spawn(f'notify-send "Move to Screen {current_screen}"') >> return __inner >> >> Key([mod, "mod1"], "h", lazy.function(-1)), >> Key([mod, "mod1"], "l", lazy.function(1)), >> >> -- >> 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/1547d562-66f4-4b89-a915-830086f22bbfn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/qtile-dev/1547d562-66f4-4b89-a915-830086f22bbfn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Guillaume Gelin > -- 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/0a07a152-85f1-4192-8d11-c82cd8189b56n%40googlegroups.com.
