# libtmux.hooks.HooksMixin

- **Module:** libtmux.hooks
- **Package:** libtmux
- **Language:** Python
- **Kind:** class
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/hooks.py#L59
- **Bases:** [`CmdMixin`](/en/py/stable/reference/libtmux-common-cmdmixin/)
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-hooks-hooksmixin/

tmux catalog: [Hooks](/en/tmux/latest/catalog/hooks/)

Mixin for manager scoped hooks in tmux.

Requires tmux 3.1+. For older versions, use raw commands.

## Members

### Common operations

- [`set_hooks`](/en/py/stable/reference/libtmux-hooks-hooksmixin-set_hooks/) (method): Set multiple indexed hooks at once.
- [`show_hook`](/en/py/stable/reference/libtmux-hooks-hooksmixin-show_hook/) (method): Return value for a hook.
- [`show_hooks`](/en/py/stable/reference/libtmux-hooks-hooksmixin-show_hooks/) (method): Return a dict of hooks for the target.

### Other members

- [`default_hook_scope`](/en/py/stable/reference/libtmux-hooks-hooksmixin-default_hook_scope/) (attribute)
- [`hooks`](/en/py/stable/reference/libtmux-hooks-hooksmixin-hooks/) (attribute)
- [`run_hook`](/en/py/stable/reference/libtmux-hooks-hooksmixin-run_hook/) (method): Run a hook immediately. Useful for testing.
- [`set_hook`](/en/py/stable/reference/libtmux-hooks-hooksmixin-set_hook/) (method): Set hook for tmux target.
- [`unset_hook`](/en/py/stable/reference/libtmux-hooks-hooksmixin-unset_hook/) (method): Unset hook for tmux target.
- [`__init__`](/en/py/stable/reference/libtmux-hooks-hooksmixin-__init__/) (method): When not a user (custom) hook, scope can be implied.
- [`_show_hook`](/en/py/stable/reference/libtmux-hooks-hooksmixin-_show_hook/) (method): Return value for the hook.
- [`_tmux_bin`](/en/py/stable/reference/libtmux-hooks-hooksmixin-_tmux_bin/) (property): Resolve tmux_bin from self (Server) or self.server (Session/Window/Pane).

## Inherited members

- [`cmd`](/en/py/stable/reference/libtmux-hooks-hooksmixin-cmd/) (attribute), inherited from `libtmux.common.CmdMixin`
