tile

A full-featured, hackable tiling window manager written and configured in Python

screenshot

  1. from libqtile.config import Key, Screen, Group, Drag, Click
  2. from libqtile.command import lazy
  3. from libqtile import layout, bar, widget
  4. try:
  5. from typing import List # noqa: F401
  6. except ImportError:
  7. pass
  8. mod = "mod4"
  9. keys = [
  10. # Switch between windows in current stack pane
  11. Key([mod], "k", lazy.layout.down()),
  12. Key([mod], "j", lazy.layout.up()),
  13. # Move windows up or down in current stack
  14. Key([mod, "control"], "k", lazy.layout.shuffle_down()),
  15. Key([mod, "control"], "j", lazy.layout.shuffle_up()),
  16. # Switch window focus to other pane(s) of stack
  17. Key([mod], "space", lazy.layout.next()),
  18. # Swap panes of split stack
  19. Key([mod, "shift"], "space", lazy.layout.rotate()),
  20. # Toggle between split and unsplit sides of stack.
  21. # Split = all windows displayed
  22. # Unsplit = 1 window displayed, like Max layout, but still with
  23. # multiple stack panes
  24. Key([mod, "shift"], "Return", lazy.layout.toggle_split()),
  25. Key([mod], "Return", lazy.spawn("xterm")),
  26. # Toggle between different layouts as defined below
  27. Key([mod], "Tab", lazy.next_layout()),
  28. Key([mod], "w", lazy.window.kill()),
  29. Key([mod, "control"], "r", lazy.restart()),
  30. Key([mod, "control"], "q", lazy.shutdown()),
  31. Key([mod], "r", lazy.spawncmd()),
  32. ]
  33. groups = [Group(i) for i in "asdfuiop"]
  34. for i in groups:
  35. keys.extend([
  36. # mod1 + letter of group = switch to group
  37. Key([mod], i.name, lazy.group[i.name].toscreen()),
  38. # mod1 + shift + letter of group = switch to & move focused window to group
  39. Key([mod, "shift"], i.name, lazy.window.togroup(i.name)),
  40. ])
  41. layouts = [
  42. layout.Max(),
  43. layout.Stack(num_stacks=2)
  44. ]
  45. widget_defaults = dict(
  46. font='sans',
  47. fontsize=12,
  48. padding=3,
  49. )
  50. extension_defaults = widget_defaults.copy()
  51. screens = [
  52. Screen(
  53. bottom=bar.Bar(
  54. [
  55. widget.GroupBox(),
  56. widget.Prompt(),
  57. widget.WindowName(),
  58. widget.TextBox("default config", name="default"),
  59. widget.Systray(),
  60. widget.Clock(format='%Y-%m-%d %a %I:%M %p'),
  61. ],
  62. 24,
  63. ),
  64. ),
  65. ]
  66. # Drag floating layouts.
  67. mouse = [
  68. Drag([mod], "Button1", lazy.window.set_position_floating(),
  69. start=lazy.window.get_position()),
  70. Drag([mod], "Button3", lazy.window.set_size_floating(),
  71. start=lazy.window.get_size()),
  72. Click([mod], "Button2", lazy.window.bring_to_front())
  73. ]
  74. dgroups_key_binder = None
  75. dgroups_app_rules = [] # type: List
  76. main = None
  77. follow_mouse_focus = True
  78. bring_front_click = False
  79. cursor_warp = False
  80. floating_layout = layout.Floating(float_rules=[
  81. {'wmclass': 'confirm'},
  82. {'wmclass': 'dialog'},
  83. {'wmclass': 'download'},
  84. {'wmclass': 'error'},
  85. {'wmclass': 'file_progress'},
  86. {'wmclass': 'notification'},
  87. {'wmclass': 'splash'},
  88. {'wmclass': 'toolbar'},
  89. {'wmclass': 'confirmreset'}, # gitk
  90. {'wmclass': 'makebranch'}, # gitk
  91. {'wmclass': 'maketag'}, # gitk
  92. {'wname': 'branchdialog'}, # gitk
  93. {'wname': 'pinentry'}, # GPG key password entry
  94. {'wmclass': 'ssh-askpass'}, # ssh-askpass
  95. ])
  96. auto_fullscreen = True
  97. focus_on_window_activation = "smart"
  98. # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
  99. # string besides java UI toolkits; you can see several discussions on the
  100. # mailing lists, github issues, and other WM documentation that suggest setting
  101. # this string if your java app doesn't work correctly. We may as well just lie
  102. # and say that we're a working one by default.
  103. #
  104. # We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
  105. # java that happens to be on java's whitelist.
  106. wmname = "LG3D"
  107. dpi_scale = 1.0

View more configuration examples on Github

Benefits of using a tiling window manager

Optimize your workflow by configuring your environment to fit how you work.

Efficiently use screen real-estate by automatically arranging windows with minimal visual cruft.

Save your wrists from RSI by ditching the mouse and driving with the keyboard.

Why Qtile?

Qtile is simple, small, and extensible. It's easy to write your own layouts, widgets, and built-in commands.

Qtile is written and configured entirely in Python. Leverage the full power and flexibility of the language to make it fit your needs.

The Qtile community is active and growing. There's always someone to lend a hand when you need help.

Qtile is free and open-source software. Distributed under the permissive MIT license.

The Qtile Community

Getting Involved