Last active
August 14, 2016 21:29
-
-
Save g8d3/1574ec23d0d809b4017f to your computer and use it in GitHub Desktop.
Script to open tabs in Ubuntu terminal using xdotool.
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
curl -L https://goo.gl/0Jxf8j -o /usr/local/bin/ntab | |
chmod +x /usr/local/bin/ntab |
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
#!/bin/bash | |
# Install xdotool first. | |
new_tab(){ | |
title=$1 | |
delay=${2:-0.5} | |
xdotool key ctrl+shift+t | |
sleep $delay | |
xdotool key alt | |
sleep $delay | |
xdotool type tit | |
xdotool key Return | |
sleep $delay | |
xdotool type $title | |
xdotool key Return | |
sleep $delay | |
} | |
new_tabs(){ | |
delay=${@: -1} | |
titles=(${@%"$delay"}) | |
#titles=(${@:-console server git rspec other routes}) | |
for title in ${titles[@]}; do | |
new_tab $title $delay | |
done | |
} | |
new_tabs "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment