Acabo de migrar a macbook desde ubuntu, para desarrollo.
Tenía un bash script en ubuntu que abría muchas pestañas de terminal, e introducía varios comandos en cada una, como ir a una carpeta en particular, abrir algún software, entrar por ssh en el live box, etc. Es mi script "listo para empezar a trabajar", que ejecuto cuando el ordenador arranca. Está en la lista de abajo. Funciona de manera bastante primitiva, usando xdotool para simular la entrada del teclado y el ratón - todo lo que haría si lo hiciera manualmente.
Me gustaría ejecutar un equivalente en mi mac - ¿existe tal cosa? Si hay alternativas, ¿cuál es la más fácil de "traducir"? gracias
#!/usr/bin/env bash
window="$(xdotool search --class mate-terminal | head -1)"
xdotool windowfocus $window
#first cd to our work folder: this will be the base window
xdotool type "cd $elearn"
xdotool key Return
#open tab for elearn with mongrel_rails start
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd ~"
xdotool key Return
xdotool type "cd $elearn"
xdotool key Return
xdotool type "source renametab mongrel"
xdotool key Return
xdotool type "mongrel_cluster_start"
xdotool key Return
#open tab for elearn with console start
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd ~"
xdotool key Return
xdotool type "cd $elearn"
xdotool key Return
xdotool type "source renametab console"
xdotool key Return
xdotool type "script/console"
xdotool key Return
#open tab for elearn, don't do anything
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd ~"
xdotool key Return
xdotool type "cd $elearn"
xdotool key Return
xdotool type "source renametab main"
xdotool key Return
#open tab for elearn, with mysql
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd $elearn"
xdotool key Return
xdotool type "source renametab mysql"
xdotool key Return
xdotool type "mysql -u root e_learning_resource_development"
xdotool key Return
#open three tabs sshd onto live box
#we need to do this now on the live box, to switch to the "nobody" user
#sudo -u nobody bash
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd $elearn"
xdotool key Return
xdotool type "ssh-live1"
xdotool key Return
xdotool type 'export PS1="$PS1""\[\e]0;live-console \a\]"'
xdotool key Return
xdotool type "cd /path/to/server/folder"
xdotool key Return
xdotool type "sudo -u nobody bash"
xdotool key Return
xdotool type "script/console production"
xdotool key Return
#same again stay on ubuntu user and don't start console
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd $elearn"
xdotool key Return
xdotool type "ssh-live1"
xdotool key Return
xdotool type 'export PS1="$PS1""\[\e]0;live1 ubuntu\a\]"'
xdotool key Return
xdotool type "cd /path/to/server/folder"
xdotool key Return
#same again but don't start console
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd $elearn"
xdotool key Return
xdotool type "ssh-live1"
xdotool key Return
xdotool type 'export PS1="$PS1""\[\e]0;live1 nobody\a\]"'
xdotool key Return
xdotool type "cd /path/to/server/folder"
xdotool key Return
xdotool type "sudo -u nobody bash"
xdotool key Return
#open tab and tail the dev log
xdotool key ctrl+shift+t
sleep 2
xdotool type "cd $elearn"
xdotool key Return
xdotool type "source renametab log"
xdotool key Return
xdotool type "tail -f log/development.log"
xdotool key Return
#go back to tab 1, then exit
xdotool key alt+1
sleep 2
xdotool type "exit"
xdotool key Return