Skip to content

Instantly share code, notes, and snippets.

@runjak
Created March 11, 2015 14:37
Show Gist options
  • Save runjak/34e92efd7e0804e2eb0a to your computer and use it in GitHub Desktop.
Save runjak/34e92efd7e0804e2eb0a to your computer and use it in GitHub Desktop.
#!/bin/sh
# Inspired by https://gist.github.com/runjak/1c76dc9e3fcda878c7c9
SESSION="wlan"
# Creating a new session:
tmux new-session -d -s $SESSION
# Splitting the window:
tmux split-window -v -t $Session:0.0
tmux split-window -h -t $Session:0.0
# Execute some fun commands:
tmux send-keys -t $SESSION:0.0 "cd /etc/wpa_supplicant" C-m
tmux send-keys -t $SESSION:0.0 "wpa_supplicant -iwlan0 -c someWlan.conf" C-m
tmux send-keys -t $SESSION:0.2 "sleep 1; dhcpcd -4 -B wlan0" C-m
tmux select-pane -t $SESSION:0.1
# Attach!
tmux attach -t $SESSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment