-
-
Save improve100/d75e9b18b39815cdc671e9ee6fc645fb to your computer and use it in GitHub Desktop.
tmux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.终端如何默认开启tmux | |
在终端的Edit里面的Profile Preference里面的Title and Command里面 | |
勾上Run a custom command instead of my shell | |
并且在 Custom command 里面填上 tmux 保存即可,这样便可以当运行终端时自动运行 tmux | |
2.利用tmux的各种强大的外部命令,我们就可以自定义脚本,自动化很多事情 | |
#!/bin/bash | |
tmux has-session -t robot | |
if [ $? != 0 ]; then | |
tmux new-session -s robot -n initrobot -d | |
tmux send-keys -t robot 'ssh [email protected]' C-m | |
tmux send-keys -t robot 'cd ~/catkin_new/src/mecanum_scripts' C-m | |
tmux send-keys -t robot './one_step_start2.py office' C-m | |
sleep 10 | |
tmux split-window -h -t robot | |
tmux new-window -n contorlrobot -t robot | |
tmux send-keys -t robot:2 'cd ~/Documents/robotplatform/robotServer/build' C-m | |
tmux send-keys -t robot:2 './server' C-m | |
tmux split-window -v -t robot | |
tmux split-window -v -t robot | |
tmux select-layout -t robot main-horizontal | |
tmux send-keys -t robot:2.1 'roslaunch states_machine vking_states_machine.launch' C-m | |
tmux send-keys -t robot:2.2 'cd ~/catkin_ws/src/robotk/mecanum_scripts' C-m | |
tmux send-keys -t robot:2.2 './one_step_power.py szon' C-m | |
tmux send-keys -t robot:2.2 './one_step_power.py dpon' C-m | |
sleep 2 | |
tmux send-keys -t robot:2.2 'cd ~/Documents/robotplatform/robotServer/build' C-m | |
tmux send-keys -t robot:1.1 'cd ~/catkin_ws/src/robotk/mecanum_scripts' C-m | |
tmux send-keys -t robot:1.1 'roslaunch ./one_step_client.launch' C-m | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment