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

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 1.44 KB  |  hits: 12  |  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. How does this script for naming iTerm tabs work?
  2. $ nametab New tab name
  3.        
  4. #!/bin/bash
  5.  
  6. # A simple script which will name a tab in iTerm
  7. # usage:
  8. # $ nametab New tab name
  9.  
  10. echo -ne "33]0;"$@"07"
  11.        
  12. chmod u+x nametab.sh
  13.        
  14. echo TERM=$TERM
  15.        
  16. TERM=xterm-256color
  17.        
  18. echo $PATH
  19.        
  20. .:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:~/dev/bash_scripts
  21.        
  22. cat ~/dev/bash_scripts/nametab.sh
  23.        
  24. #!/bin/bash
  25.  
  26. # A simple script which will name a tab in iTerm
  27. # usage:
  28. # $ nametab NewTabName
  29.  
  30. echo "trying to rename the current tab to $@"
  31. echo -ne "33]0;"$@"07"
  32. echo "finished"
  33.        
  34. nametab.sh hellooooo
  35.        
  36. trying to rename the current tab to helloooo
  37. finished
  38.        
  39. MindRoot (bash)
  40.        
  41. # System-wide .bashrc file for interactive bash(1) shells.
  42. if [ -z "$PS1" ]; then
  43.    return
  44. fi
  45.  
  46. #PS1='h:W u$ '
  47. # Make bash check its window size after a process completes
  48. shopt -s checkwinsize
  49.  
  50. # ALL OF THE BELOW ADDED BY DEONOMO ON 2011-04-25
  51.  
  52. # custom prompt
  53. PROMPT_HOSTNAME='MindRoot'
  54. PROMPT_COLOR='0;35m'
  55.  
  56. # If I am root, set the prompt to bright red
  57. if [ ${UID} -eq 0 ]; then
  58. PROMPT_COLOR='1;31m'
  59. fi
  60.  
  61. PS1='[e]1;${PROMPT_HOSTNAME}ae]2;${PROMPT_HOSTNAME}:${PWD}a
  62. e[${PROMPT_COLOR}]
  63. [u@${PROMPT_HOSTNAME} w]n #$
  64. [e[m]'
  65.  
  66. #PS1="e[0;45mw:$ "
  67.  
  68. # added by Deonomo on 2011/09/12 in order to have textmate work as default editor
  69. export EDITOR='mate -w'
  70.  
  71. # added by Deonomo on 2012-01-11 in order to start a dev/bash_scripts directory
  72. export PATH="$PATH:~/dev/bash_scripts"