A simple alternative to Chef and Puppet to bootstrap *nix machines.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

56 lines
1.4 KiB

  1. #! /bin/bash
  2. # Gets the current settings for the given terminal window
  3. function get_terminal_settings {
  4. case "$TERM_PROGRAM" in
  5. Apple_Terminal)
  6. osascript <<EOD
  7. set current_tty to "$(tty)"
  8. tell application "Terminal"
  9. repeat with win in windows
  10. repeat with the_tab in tabs of win
  11. set tab_settings to the current settings of the_tab
  12. if current_tty is equal to the tty of the_tab then
  13. return the name of tab_settings
  14. end if
  15. end repeat
  16. end repeat
  17. end tell
  18. EOD
  19. ;;
  20. iTerm.app)
  21. echo "$ITERM_PROFILE"
  22. ;;
  23. *)
  24. echo "Unknown terminal $TERM_PROGRAM"
  25. exit 1
  26. esac
  27. }
  28. # Mappings of Terminal themes to color schemes
  29. function get_vim_colorscheme {
  30. local term_theme="$1"
  31. case "$term_theme" in
  32. "Hotkey Window Wombat")
  33. echo "wombat256mod"
  34. ;;
  35. Wombat*)
  36. echo "wombat256mod"
  37. ;;
  38. Solarized*)
  39. echo "solarized"
  40. ;;
  41. "Yosemite Light"*)
  42. echo "morning"
  43. ;;
  44. "Yosemite Dark"*)
  45. echo "vividchalk"
  46. ;;
  47. *)
  48. echo "wombat256mod"
  49. ;;
  50. esac
  51. }
  52. get_vim_colorscheme "$(get_terminal_settings)"