Skip to content

Instantly share code, notes, and snippets.

@Digicrat
Created July 3, 2018 09:07
Show Gist options
  • Save Digicrat/92e7313a93624544083810b687f41146 to your computer and use it in GitHub Desktop.
Save Digicrat/92e7313a93624544083810b687f41146 to your computer and use it in GitHub Desktop.
tmux script example
#!/bin/bash
SESSION=tmux_test
tmux -2 new-session -d -s $SESSION
# Setup Window 1
tmux new-window -t $SESSION:1 -n 'Logs'
tmux split-window -h
tmux select-pane -t 0
tmux send-keys "tail -f /var/log/lastlog" C-m
tmux select-pane -t 1
tmux send-keys "echo 'Test Cmd'" C-m
# Setup a MySQL window
tmux new-window -t $SESSION:2 -n 'Emacs' 'emacs tmux_test.sh'
# Set default window
tmux select-window -t $SESSION:1
# Attach to session
tmux -2 attach-session -t $SESSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment