Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. # Strip down a FQDN
  2. hostname="$(hostname | sed 's/..*//')"
  3. # Use the case pattern for server groups
  4. case "$hostname" in
  5. mario|luigi|toad|peach|koopa*|bowser) export SCREENRC=~/.screenrc_prod;;
  6. dev*|vm*) export SCREENRC=~/.screenrc_dev;;
  7. esac
  8. # Use condensed bash "new test*" notation to override for specific servers
  9. # e.g. ~/.screenrc_bowser would get used instead of ~/.screenrc_prod
  10. [[ -f "~/.screenrc_$hostname" ]] && export SCREENRC="~/.screenrc_$hostname"
  11.  
  12. GT_RESET=$( tput sgr0) # Reset all attributes
  13. GT_BRIGHT=$( tput bold) # Set “bright” attribute
  14. GT_DIM=$( tput dim) # Set “dim” attribute (normal/non-bright)
  15. GT_ULINE=$( tput smul) # Set “underscore” (underlined text) attribute
  16. GT_BLINK=$( tput blink) # Set “blink” attribute
  17. GT_INVERSE=$( tput rev) # Set “inverse” attribute
  18. GT_HIDDEN=$( tput invis) # Set “hidden” attribute
  19.  
  20. FG_BLACK=$( tput setaf 0) #foreground to color #0 - black
  21. FG_RED=$( tput setaf 1) #foreground to color #1 - red
  22. FG_GREEN=$( tput setaf 2) #foreground to color #2 - green
  23. FG_YELLOW=$( tput setaf 3) #foreground to color #3 - yellow
  24. FG_BLUE=$( tput setaf 4) #foreground to color #4 - blue
  25. FG_MAGENTA=$( tput setaf 5) #foreground to color #5 - magenta
  26. FG_CYAN=$( tput setaf 6) #foreground to color #6 - cyan
  27. FG_WHITE=$( tput setaf 7) #foreground to color #7 - white
  28.  
  29. BG_BLACK=$( tput setab 0) #background to color #0 - black
  30. BG_RED=$( tput setab 1) #background to color #1 - red
  31. BG_GREEN=$( tput setab 2) #background to color #2 - green
  32. BG_YELLOW=$( tput setab 3) #background to color #3 - yellow
  33. BG_BLUE=$( tput setab 4) #background to color #4 - blue
  34. BG_MAGENTA=$( tput setab 5) #background to color #5 - magenta
  35. BG_CYAN=$( tput setab 6) #background to color #6 - cyan
  36. BG_WHITE=$( tput setab 7) #background to color #7 - white
  37.  
  38. hardstatus alwayslastline "%{rk}%H %{gk}%c %{yk}%M%d %{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw%?"
  39.  
  40. #!/bin/bash
  41. Red="05{..r}"
  42. Yellow="05{..y}"
  43. Green="05{..g}"
  44. Blue="05{..b}"
  45. Magenta="05{..m}"
  46. Cyan="05{..c}"
  47. White="05{..w}"
  48.  
  49. case "$HOSTNAME" in
  50. lubuntu-eee)
  51. echo -e "$Magenta$HOSTNAME"
  52. ;;
  53. ubuntu-pc)
  54. echo -e "$Magenta$HOSTNAME"
  55. ;;
  56. *)
  57. echo -e "$Green$HOSTNAME"
  58. esac
  59.  
  60. backtick 4 3600 3600 /usr/local/bin/screen_hostname
  61. caption always "%{.kc}%D %d.%m.%Y %=%{.kg} %4` %{.kc}%0c"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement