Metadata-Version: 2.1
Name: tmux-restore
Version: 0.0.4
Summary: A python executable that saves and restores tmux sessions across reboots
Project-URL: Homepage, https://github.com/arjunghoshal/tmux-restore
Project-URL: Issues, https://github.com/arjunghoshal/tmux-restore/issues
Author-email: Arjun Ghoshal <arjunp.ghoshal@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: dacite
Requires-Dist: libtmux
Requires-Dist: psutil
Requires-Dist: pyyaml
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# tmux-restore

## Overview
Works with `tmux` to save and restore sessions across reboots. Sessions are stored at `~/.tmux-restore`.

## Features
- Save session windows, panes, and layouts automatically on detach/exit
- Automatically restore sessions on reboot
    - Restores windows, panes, and layout
    - Restores running processes for select programs:
        - emacs/vi/vim/nvim
        - man
        - less/more
        - tail
        - top/htop
        - irssi/weechat/mutt
        - ssh
        - psql/mysql/sqlite3

## To Do
- Save environment variables
- Add configuration option for session file
- Add configuration option for adding running programs to save

## Set Up
To install `tmux-restore`, run the following:
```bash
pip install tmux-restore
```
Then, to restore your saved sessions on reboot, edit your `.bashrc` file with the following content:
```bash
# colors...

# tmux-restore trigger
if ! tmux info &> /dev/null; then
    if ! tmux ls &> /dev/null; then
        (python3 -m tmux-restore &)
    fi
fi

# aliases...
```
It is important that this is done above alias definition to avoid conflicts.
Finally, add the following content to either where the other aliases are defined in your `.bashrc` file or to your `.bash_aliases` file:
```bash
tmux() {
    command tmux $*
    (python3 -m tmux-restore save &)
}
```
This will ensure that your sessions save after you exit or detach from a `tmux` session. Restart your shell to apply the effects.
Your tmux sessions will now restore themselves across reboots!

## Usage
If you would like to save or restore your `tmux` sessions manually:
```bash
# Save
python3 -m tmux-restore save

# Restore
python3 -m tmux-restore
# OR
python3 -m tmux-restore restore
```
