Built-in Hooks

subscribe.addgroup(func)

Called when group is added

Arguments

  • qtile manager instance
  • name of new group
subscribe.changegroup(func)

Called whenever a group change occurs

Arguments

None

subscribe.client_focus(func)

Called whenever focus changes

Arguments

  • window.Window object of the new focus.
subscribe.client_killed(func)

Called after a client has been unmanaged

Arguments

  • window.Window object of the killed window.
subscribe.client_managed(func)

Called after Qtile starts managing a new client

Called after a window is assigned to a group, or when a window is made static. This hook is not called for internal windows.

Arguments

  • window.Window object of the managed window
subscribe.client_mouse_enter(func)

Called when the mouse enters a client

Arguments

  • window.Window of window entered
subscribe.client_name_updated(func)

Called when the client name changes

Never fires

subscribe.client_new(func)

Called before Qtile starts managing a new client

Use this hook to declare windows static, or add them to a group on startup. This hook is not called for internal windows.

Arguments

  • window.Window object

Examples

@libqtile.hook.subscribe.client_new
def func(c):
    if c.name == "xterm":
        c.togroup("a")
    elif c.name == "dzen":
        c.static(0)
subscribe.client_state_changed(func)

Called whenever client state changes

Never fires

subscribe.client_type_changed(func)

Called whenever window type changes

Never fires

subscribe.client_urgent_hint_changed(func)

Called when the client urgent hint changes

Arguments

  • window.Window of client with hint change
subscribe.current_screen_change(func)

Called when the current screen (i.e. the screen with focus) changes

Arguments

None

subscribe.delgroup(func)

Called when group is deleted

Arguments

  • qtile manager instance
  • name of deleted group
subscribe.float_change(func)

Called when a change in float state is made

Arguments

None

subscribe.focus_change(func)

Called when focus is changed

Arguments

None

subscribe.group_window_add(func)

Called when a new window is added to a group

Arguments

None

subscribe.layout_change(func)

Called on layout change

Arguments

  • layout object for new layout
  • group object on which layout is changed
subscribe.net_wm_icon_change(func)

Called on _NET_WM_ICON chance

Arguments

  • window.Window of client with changed icon
subscribe.screen_change(func)

Called when a screen is added or screen configuration is changed (via xrandr)

Common usage is simply to call qtile.cmd_restart() on each event (to restart qtile when there is a new monitor):

Arguments

  • qtile manager instance
  • xproto.randr.ScreenChangeNotify event

Examples

@libqtile.hook.subscribe.screen_change
def restart_on_randr(qtile, ev):
    qtile.cmd_restart()
subscribe.selection_change(func)

Called on selection change

Arguments

  • name of the selection
  • dictionary describing selection, containing owner and selection as keys
subscribe.selection_notify(func)

Called on selection notify

Arguments

  • name of the selection
  • dictionary describing selection, containing owner and selection as keys
subscribe.setgroup(func)

Called when group is changed

Arguments

None

subscribe.startup(func)

Called when qtile is started

Arguments

None

subscribe.startup_complete(func)

Called when qtile is started after all resources initialized

Arguments

None

subscribe.startup_once(func)

Called when Qtile has started on first start

This hook is called exactly once per session (i.e. not on each lazy.restart()).

Arguments

None

subscribe.window_name_change(func)

Called whenever a windows name changes

Arguments

None