~/.wazarc is executed every time terminal is launched. My .wazarc is the below.
# execute tmux [ -z "$TMUX" ] && \. "$HOME/starttmux.sh" # run elastic search cd /tmp && sudo /usr/share/elasticsearch/bin/elasticsearch -Des.insecure.allow.root=true & # run redis cd /tmp && redis-server &
As you can see, i'm bring up tmux, elasticsearch and redis for my (current) project.
I'm using tmux and it has modules to save/restore sessions, called tmux-resurrect. Here is may `.tmuxrc`
#================== # List of plugins #================== set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' # restore sessions set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @resurrect-processes '"~rails c" "~rails s"' # add rails set -g @resurrect-strategy-nvim 'session' if "test ! -d ~/.tmux/plugins/tpm" \ "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" run '~/.tmux/plugins/tpm/tpm'
Just for reference, starttmux.sh is below. (I do send-keys to restore here)
#!/bin/bash session="work" tmux has-session -t $session 2>/dev/null if [ "$?" -eq 1 ] ; then # set up tmux tmux start-server # create a new tmux session, starting vim from a saved session in the new window tmux -u new-session -d -s $session # restore tmux send-keys -t $session cd /home/shohey1226/.tmux/plugins/tmux-resurrect/scripts/ && /home/shohey1226/.tmux/plugins/tmux-resurrect/scripts/restore.sh enter else echo "session found. connecting..." fi #tmux attach-session -t $session