Scripts for automating tasks on the mac command line.

atom-installer.sh 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #!/bin/bash
  2. clear
  3. printf "\n\033[104mAtom IDE Installer & Configuration Script\033[49m\n"
  4. printf "by James Peret - http://jamesperet.com\n\n"
  5. # Load installer script dependencies
  6. DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
  7. source $DIR/core.sh
  8. function install_plugins {
  9. # install Atom Plugins
  10. echo "Installing Atom Plugins:"
  11. apm install graphite-ui
  12. apm install railscast-theme
  13. apm install browser-plus
  14. apm install term2
  15. apm install file-icons
  16. apm install pane-layout-plus
  17. apm install pigments
  18. apm install project-manager
  19. apm install project-sidebar
  20. #apm install git-tab-status
  21. apm install less-than-slash
  22. apm install wordcount
  23. apm install markdown-preview-opener
  24. apm install markdown-scroll-sync
  25. apm install maybs-quit
  26. apm install time-status
  27. apm install wakatime
  28. #apm install toggle-tabs
  29. apm install pane-info
  30. apm install rails-partials
  31. }
  32. function configure_keymap {
  33. echo "Configuring keymap"
  34. printf "
  35. 'body':
  36. 'f6': 'status-bar:toggle'
  37. 'ctrl-tab': 'pane:show-next-item'
  38. 'ctrl-shift-tab': 'pane:show-previous-item'
  39. 'ctrl-alt-tab' : 'window:focus-next-pane'
  40. 'ctrl-alt-shift-tab' : 'window:focus-previous-pane'
  41. 'ctrl-alt-cmd-p' : 'project-sidebar:toggle'
  42. " > $HOME/.atom/keymap.cson
  43. }
  44. function configure_styles {
  45. echo "Configuring sytles"
  46. printf "
  47. atom-workspace .browser-page webview {
  48. margin: 0px;
  49. }
  50. webview {
  51. margin: 0px;
  52. }
  53. .pane-info {
  54. margin-right: 12px;
  55. margin-top: 8px;
  56. }
  57. .right.tool-panel.panel-right {
  58. background-color: #2B2E31;
  59. }
  60. .project-sidebar.padded {
  61. background-color: #3a3e42;
  62. line-height: 32px;
  63. height: 40px;
  64. padding: 0px;
  65. color: #ffffff;
  66. }
  67. .project-sidebar.padded h1 {
  68. margin: 0px;
  69. padding: 0px;
  70. height: 40px;
  71. font-size: 13px;
  72. font-weight: 400;
  73. padding-top: 16px;
  74. padding-left: 8px;
  75. }
  76. .project-sidebar.padded li {
  77. padding-left: 8px;
  78. padding-right: 10px;
  79. }
  80. body {
  81. -webkit-font-smoothing: antialiased;
  82. -moz-osx-font-smoothing: grayscale;
  83. /*text-rendering: optimizeLegibility; */
  84. }
  85. .tree-view-resizer, .editor {
  86. ::-webkit-scrollbar {
  87. width: 0.5em;
  88. height: 0.5em;
  89. }
  90. ::-webkit-scrollbar-track {
  91. background-color: #303030;
  92. }
  93. ::-webkit-scrollbar-thumb {
  94. background-color: lighten(#303030, 15%%);
  95. }
  96. }
  97. \n
  98. " > $HOME/.atom/styles.less
  99. }
  100. function check_dependencies {
  101. if [ $(program_is_installed atom) ] ; then
  102. if [ $(program_is_installed node) ] ; then
  103. if [ ! $(program_is_installed apm) ] ; then
  104. echo "APM is not installed. Opening the Atom editor and click on Install Shell Commands."
  105. return false
  106. fi
  107. return true
  108. else
  109. echo "Node is not installed. Please make sure it is intalled before procedding with this script."
  110. return false
  111. fi
  112. else
  113. echo "Atom is not installed. Please make sure it is intalled before procedding with this script."
  114. return false
  115. fi
  116. }
  117. # Run Program
  118. if [ check_dependencies ] ; then
  119. install_plugins
  120. configure_keymap
  121. configure_styles
  122. echo "\n\n\033[32mATOM CONFIGURED SUCCESFULLY\n\n"
  123. fi