Skip to content

Conversation

noscript
Copy link
Contributor

Adds two for save restore events, that could be used to e.g. save and restore terminal window geometry, like so:

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)'

fi
if [ -n "$(save_hook)" ]; then
eval "$(save_hook)"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be just after the save_all

start_spinner "Restoring..." "Tmux restore complete!"
if [ -n "$(restore_hook)" ]; then
eval "$(restore_hook)"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tricksy one - I would like a hook that is run for each pane. Once you add one hook people quickly want a hook everywhere, eh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants