qtile scripting through callables; switching to specific layout
Scripting Commands — Qtile 0.1.dev50+ga708c8c.d20211209 documentation has a lot more interesting stuff than the ones exposed through “vanilla” config, finally figured out how to use them:
def test(qtile): qtile.cmd_to_layout_index(0) # ... Key([mod, ctrl], "apostrophe", lazy.function(test))
qtile object passed as the first argument is exactly the
QTile from scripting.
Qtile switching to a layout by id
To parametrize it, you have to let it return a callable function:
def switch_to(ly_id: int): def cb(qtile): qtile.cmd_to_layout_index(ly_id) return cb # ... Key([mod, ctrl], "apostrophe", lazy.function(switch_to(0))),
More fun with qtile scripting
I don’t see this mentioned in the docu, but the attributes can be found in the source of libqtile.core.manager — Qtile 0.1.dev50+ga708c8c.d20211209 documentation.