Skip to content

Instantly share code, notes, and snippets.

@g8d3
Last active August 14, 2016 21:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g8d3/1574ec23d0d809b4017f to your computer and use it in GitHub Desktop.
Save g8d3/1574ec23d0d809b4017f to your computer and use it in GitHub Desktop.
Script to open tabs in Ubuntu terminal using xdotool.
curl -L https://goo.gl/0Jxf8j -o /usr/local/bin/ntab
chmod +x /usr/local/bin/ntab
#!/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