Skip to content

Instantly share code, notes, and snippets.

@MacRusher
Created October 4, 2018 13:05
Show Gist options
  • Save MacRusher/f0b39a944275851a0596d0ad45f98a30 to your computer and use it in GitHub Desktop.
Save MacRusher/f0b39a944275851a0596d0ad45f98a30 to your computer and use it in GitHub Desktop.
Execute commands in multiple terminal tabs
#!/usr/bin/env bash
exec_in_new_tab() {
xdotool key 'ctrl+shift+t';
sleep 1;
for cmd in "$@"
do
xdotool type --delay 1 --clearmodifiers "$cmd";
xdotool key 'Return';
done
}
#exec_in_new_tab "cd someDir" "yarn start";
#exec_in_new_tab "npm run someCommand";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment