The idea here is when I work on a system, I want to open tmux and have it automatically open all the windows I always open. This will save me manually doing all that, and give me consistency of what window is where so I can build muscle memory and quit flapping around looking for the right window.
For reasons beyond my comprehension, instead of just issuing the usual tmux
, you actually need to tmux attach
. I guess that is a good thing regardless, as if the main tmux session is already open I would just want to reconnect.
Anyway, here are some tmux.conf examples:
WWW
Here is an apache web server, called www.
mr@www:~$ cat .tmux.conf
new -s www -c /etc/apache2 #create new session for www
rename-window /etc/apache2/ #rename first window
new-window -c /var/log/apache2/ #make a second window
rename-window /var/log/apache2/ #rename second window
new-window -c /var/www/rushworx.net/
rename-window rushworx.net
mr@www:~$ tmux attach
Nextcloud
A nextcloud server
mr@nextcloud:~$ cat .tmux.conf
new -s nextcloud -c /home/nextcloud_data #create new session for nextcloud
rename-window /home/nextcloud_data/ #rename first window
new-window -c /var/log/ #make a second window
rename-window /var/log/ #rename second window
new-window -c /home/mr/
rename-window /home/mr/
Sources
This github gist helped me figure out some of the odd tmux config usage
https://gist.github.com/Muzietto/325344c2b1b3b723985a85800cafef4f