mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2025-09-03 13:57:01 +00:00
Save and restore hooks
This commit is contained in:

committed by
Ash Berlin-Taylor

parent
42f77b303c
commit
0133c7a96a
14
docs/hooks.md
Normal file
14
docs/hooks.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Save & Restore Hooks
|
||||
|
||||
Hooks allow to set custom commands that will be executed during session save and restore.
|
||||
|
||||
Currently the following hooks are supported:
|
||||
|
||||
- `@resurrect-save-hook` - executed after session save
|
||||
- `@resurrect-restore-hook` - executed before session restore
|
||||
|
||||
Here is an example how to save and restore window geometry for most terminals in X11.
|
||||
Add this to `.tmux.conf`:
|
||||
|
||||
set -g @resurrect-save-hook 'eval $(xdotool getwindowgeometry --shell $WINDOWID); echo 0,$X,$Y,$WIDTH,$HEIGHT > $HOME/.tmux/resurrect/geometry'
|
||||
set -g @resurrect-restore-hook 'wmctrl -i -r $WINDOWID -e $(cat $HOME/.tmux/resurrect/geometry)'
|
Reference in New Issue
Block a user