Skip to content

Instantly share code, notes, and snippets.

@saberma
Created July 23, 2010 10:56
Show Gist options
  • Save saberma/487285 to your computer and use it in GitHub Desktop.
Save saberma/487285 to your computer and use it in GitHub Desktop.
开机运行常用terminal
#!/bin/bash
#开机启动时快速进入开发环境
#chmod +x startup.sh
#一定要以login方式执行,否则不会加载~/.bashrc
#bash -l startup.sh
#增加Ubuntu的启动项:System-Perferences-Startup Applications
##2.开启chrome
chromium-browser &
##1.直接开启3个terminal,分别用于vim编辑、输入常用命令、测试
gnome-terminal \
--working-directory='/home/saberma/Documents/shopqi' \
--tab -e vim \
--tab \
--tab \
--maximize \
--hide-menubar &
sleep 1
#wmctrl -r Terminal -N first
#3.开启4个terminal,分别用于启动开发环境的应用服务器,cucumber测试drb,rspec测试drb,查看开发日志,查看测试日志
gnome-terminal \
--working-directory='/home/saberma/Documents/shopqi' \
--tab -t unicorn \
--tab -t cucumber \
--tab -t rspec \
--tab -e "bash -l -c 'cd ~/Documents/shopqi && tail -f log/development.log'" -t dev_log \
--tab -e "bash -l -c 'cd ~/Documents/shopqi && tail -f log/test.log'" -t test_log \
--maximize \
--hide-menubar &
#4.开启英语(点击窗口关闭后会只显示在任务栏中)
rhythmbox --playlists-file= ~/english.pls &
sleep 2
# 播放英语(发送多个自动播放指令,确保rhythmbox已启动并能接收到)
rhythmbox-client --play
rhythmbox-client --play
rhythmbox-client --play
rhythmbox-client --play
#切换至第2个Workspace
#sudo apt-get install wmctrl #确保wmctrl已安装 #wmctrl -l 可查看程序窗口名称
wmctrl -r test_log -t 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment