Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 20th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/env zsh
  2.  
  3. WN=`uuidgen | cut -c1-10`
  4.  
  5. cd /opt/local/bin; tmux new-window -n $WN;
  6.  
  7. case "$@" in
  8.   #
  9.   home);      tmux send-keys -t$WN 'cd ~; clear' C-m ;;
  10.   www);       tmux send-keys -t$WN 'cd /var/www; clear' C-m ;;
  11.   etc);       tmux send-keys -t$WN 'cd /etc; clear' C-m ;;
  12.   etcp);      tmux send-keys -t$WN 'cd /opt/local/etc; clear' C-m ;;
  13.   pythonhome);tmux send-keys -t$WN 'cd /opt/local/Library/Frameworks/Python.framework/Versions/Current; clear' C-m ;;
  14.   # project
  15.   gc);        tmux send-keys -t$WN 'cd /var/www/php/gc; clear' C-m ;;
  16.   gcsource);  tmux send-keys -t$WN 'cd /var/www/php/gc/php/source; clear' C-m ;;
  17.   # any
  18.   *);         tmux send-keys -t$WN "cd $@; clear" C-m ;;
  19. esac
  20.  
  21. tmux rename-window "`basename $@`"