Built-in Hooks¶
-
classmethod
subscribe.addgroup(func)¶ Called when group is added
Arguments
- qtile manager instance
- name of new group
-
classmethod
subscribe.changegroup(func)¶ Called whenever a group change occurs
Arguments
None
-
classmethod
subscribe.client_focus(func)¶ Called whenever focus changes
Arguments
window.Windowobject of the new focus.
-
classmethod
subscribe.client_killed(func)¶ Called after a client has been unmanaged
Arguments
window.Windowobject of the killed window.
-
classmethod
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.Windowobject of the managed window
-
classmethod
subscribe.client_mouse_enter(func)¶ Called when the mouse enters a client
Arguments
window.Windowof window entered
-
classmethod
subscribe.client_name_updated(func)¶ Called when the client name changes
Arguments
window.Windowof client with updated name
-
classmethod
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.Windowobject
Examples
@libqtile.hook.subscribe.client_new def func(c): if c.name == "xterm": c.togroup("a") elif c.name == "dzen": c.static(0)
-
classmethod
subscribe.client_urgent_hint_changed(func)¶ Called when the client urgent hint changes
Arguments
window.Windowof client with hint change
-
classmethod
subscribe.current_screen_change(func)¶ Called when the current screen (i.e. the screen with focus) changes
Arguments
None
-
classmethod
subscribe.delgroup(func)¶ Called when group is deleted
Arguments
- qtile manager instance
- name of deleted group
-
classmethod
subscribe.enter_chord(func)¶ Called when key chord begins
Arguments
- name of chord(mode)
-
classmethod
subscribe.float_change(func)¶ Called when a change in float state is made
Arguments
None
-
classmethod
subscribe.focus_change(func)¶ Called when focus is changed
Arguments
None
-
classmethod
subscribe.group_window_add(func)¶ Called when a new window is added to a group
Arguments
None
-
classmethod
subscribe.layout_change(func)¶ Called on layout change
Arguments
- layout object for new layout
- group object on which layout is changed
-
classmethod
subscribe.leave_chord(func)¶ Called when key chord ends
Arguments
None
-
classmethod
subscribe.net_wm_icon_change(func)¶ Called on _NET_WM_ICON chance
Arguments
window.Windowof client with changed icon
-
classmethod
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.ScreenChangeNotifyevent
Examples
@libqtile.hook.subscribe.screen_change def restart_on_randr(qtile, ev): qtile.cmd_restart()
-
classmethod
subscribe.selection_change(func)¶ Called on selection change
Arguments
- name of the selection
- dictionary describing selection, containing
ownerandselectionas keys
-
classmethod
subscribe.selection_notify(func)¶ Called on selection notify
Arguments
- name of the selection
- dictionary describing selection, containing
ownerandselectionas keys
-
classmethod
subscribe.setgroup(func)¶ Called when group is changed
Arguments
None
-
classmethod
subscribe.startup(func)¶ Called when qtile is started
Arguments
None
-
classmethod
subscribe.startup_complete(func)¶ Called when qtile is started after all resources initialized
Arguments
None
-
classmethod
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
-
classmethod
subscribe.window_name_change(func)¶ Called whenever a windows name changes
Deprecated: use client_name_updated Arguments
None