theme 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. #!/bin/bash
  2. themeName="$1"
  3. if [ ! -f epicyon-profile.css ]; then
  4. echo 'Run this in your Epicyon install directory'
  5. exit 0
  6. fi
  7. if [[ "$themeName" == 'default' ]]; then
  8. if [ -f config.json ]; then
  9. if grep -q '"theme"' config.json; then
  10. sed -i '/"theme"/d' config.json
  11. fi
  12. fi
  13. if [ -f epicyon.css ]; then
  14. rm epicyon.css
  15. fi
  16. if [ -f login.css ]; then
  17. rm login.css
  18. fi
  19. if [ -f follow.css ]; then
  20. rm follow.css
  21. fi
  22. if [ -f suspended.css ]; then
  23. rm suspended.css
  24. fi
  25. fi
  26. if [[ "$themeName" == 'purple'* ]]; then
  27. if [ -f config.json ]; then
  28. if grep -q '"theme"' config.json; then
  29. sed -i 's|"theme".*|"theme": "purple",|g' config.json
  30. else
  31. sed -i '/"admin"/a "theme": "purple",' config.json
  32. sed -i 's|"theme"| "theme"|g' config.json
  33. fi
  34. fi
  35. cp epicyon-profile.css epicyon.css
  36. filename=epicyon.css
  37. sed -i "s|--main-bg-color:.*|--main-bg-color: #1f152d;|g" "$filename"
  38. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #1a142d;|g" "$filename"
  39. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #12152d;|g" "$filename"
  40. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  41. sed -i "s|--main-fg-color:.*|--main-fg-color: #f98bb0;|g" "$filename"
  42. sed -i "s|--border-color:.*|--border-color: #3f2145;|g" "$filename"
  43. sed -i "s|--main-link-color:.*|--main-link-color: #ff42a0;|g" "$filename"
  44. sed -i "s|--main-visited-color:.*|--main-visited-color: #f93bb0;|g" "$filename"
  45. sed -i "s|--time-color:.*|--time-color: #f98bb0;|g" "$filename"
  46. sed -i "s|--button-selected:.*|--button-selected: #fe42a0;|g" "$filename"
  47. sed -i "s|--button-background:.*|--button-background: #ff42a0;|g" "$filename"
  48. sed -i "s|--button-text:.*|--button-text: white;|g" "$filename"
  49. sed -i "s|background-color: #554;|background-color: #ff42a0;|g" "$filename"
  50. sed -i "s|color: #FFFFFE;|color: #1f152d;|g" "$filename"
  51. cp epicyon-login.css login.css
  52. filename=login.css
  53. sed -i "s|--main-bg-color:.*|--main-bg-color: #1f152d;|g" "$filename"
  54. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #1a142d;|g" "$filename"
  55. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #12152d;|g" "$filename"
  56. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  57. sed -i "s|--main-fg-color:.*|--main-fg-color: #f98bb0;|g" "$filename"
  58. sed -i "s|--border-color:.*|--border-color: #3f2145;|g" "$filename"
  59. sed -i "s|--main-link-color:.*|--main-link-color: #ff42a0;|g" "$filename"
  60. sed -i "s|--main-visited-color:.*|--main-visited-color: #f93bb0;|g" "$filename"
  61. sed -i "s|--time-color:.*|--time-color: #f98bb0;|g" "$filename"
  62. sed -i "s|--button-selected:.*|--button-selected: #fe42a0;|g" "$filename"
  63. sed -i "s|--button-background:.*|--button-background: #ff42a0;|g" "$filename"
  64. sed -i "s|--button-text:.*|--button-text: white;|g" "$filename"
  65. sed -i "s|background-color: #554;|background-color: #ff42a0;|g" "$filename"
  66. sed -i "s|color: #FFFFFE;|color: #1f152d;|g" "$filename"
  67. cp epicyon-follow.css follow.css
  68. filename=follow.css
  69. sed -i "s|--main-bg-color:.*|--main-bg-color: #1f152d;|g" "$filename"
  70. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #1a142d;|g" "$filename"
  71. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #12152d;|g" "$filename"
  72. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  73. sed -i "s|--main-fg-color:.*|--main-fg-color: #f98bb0;|g" "$filename"
  74. sed -i "s|--border-color:.*|--border-color: #3f2145;|g" "$filename"
  75. sed -i "s|--main-link-color:.*|--main-link-color: #ff42a0;|g" "$filename"
  76. sed -i "s|--main-visited-color:.*|--main-visited-color: #f93bb0;|g" "$filename"
  77. sed -i "s|--time-color:.*|--time-color: #f98bb0;|g" "$filename"
  78. sed -i "s|--button-selected:.*|--button-selected: #fe42a0;|g" "$filename"
  79. sed -i "s|--button-background:.*|--button-background: #ff42a0;|g" "$filename"
  80. sed -i "s|--button-text:.*|--button-text: white;|g" "$filename"
  81. sed -i "s|background-color: #554;|background-color: #ff42a0;|g" "$filename"
  82. sed -i "s|color: #FFFFFE;|color: #1f152d;|g" "$filename"
  83. cp epicyon-suspended.css suspended.css
  84. filename=suspended.css
  85. sed -i "s|--main-bg-color:.*|--main-bg-color: #1f152d;|g" "$filename"
  86. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #1a142d;|g" "$filename"
  87. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #12152d;|g" "$filename"
  88. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  89. sed -i "s|--main-fg-color:.*|--main-fg-color: #f98bb0;|g" "$filename"
  90. sed -i "s|--border-color:.*|--border-color: #3f2145;|g" "$filename"
  91. sed -i "s|--main-link-color:.*|--main-link-color: #ff42a0;|g" "$filename"
  92. sed -i "s|--main-visited-color:.*|--main-visited-color: #f93bb0;|g" "$filename"
  93. sed -i "s|--time-color:.*|--time-color: #f98bb0;|g" "$filename"
  94. sed -i "s|--button-selected:.*|--button-selected: #fe42a0;|g" "$filename"
  95. sed -i "s|--button-background:.*|--button-background: #ff42a0;|g" "$filename"
  96. sed -i "s|--button-text:.*|--button-text: white;|g" "$filename"
  97. sed -i "s|background-color: #554;|background-color: #ff42a0;|g" "$filename"
  98. sed -i "s|color: #FFFFFE;|color: #1f152d;|g" "$filename"
  99. fi
  100. if [[ "$themeName" == 'hack'* || "$themeName" == 'hax'* ]]; then
  101. if [ -f config.json ]; then
  102. if grep -q '"theme"' config.json; then
  103. sed -i 's|"theme".*|"theme": "hacker",|g' config.json
  104. else
  105. sed -i '/"admin"/a "theme": "hacker",' config.json
  106. sed -i 's|"theme"| "theme"|g' config.json
  107. fi
  108. fi
  109. cp epicyon-profile.css epicyon.css
  110. filename=epicyon.css
  111. sed -i "s|--main-bg-color:.*|--main-bg-color: black;|g" "$filename"
  112. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #030202;|g" "$filename"
  113. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #050202;|g" "$filename"
  114. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  115. sed -i "s|--main-fg-color:.*|--main-fg-color: green;|g" "$filename"
  116. sed -i "s|--border-color:.*|--border-color: darkgreen;|g" "$filename"
  117. sed -i "s|--main-link-color:.*|--main-link-color: #266020;|g" "$filename"
  118. sed -i "s|--main-visited-color:.*|--main-visited-color: #3c8234;|g" "$filename"
  119. sed -i "s|--time-color:.*|--time-color: green;|g" "$filename"
  120. sed -i "s|--button-selected:.*|--button-selected: #063200;|g" "$filename"
  121. sed -i "s|--button-background:.*|--button-background: #062200;|g" "$filename"
  122. sed -i "s|--button-text:.*|--button-text: green;|g" "$filename"
  123. sed -i "s|font-family:.*|font-family: Courier;|g" "$filename"
  124. sed -i "s|background-color: #554;|background-color: #062200;|g" "$filename"
  125. sed -i "s|color: #FFFFFE;|color: green;|g" "$filename"
  126. cp epicyon-login.css login.css
  127. filename=login.css
  128. sed -i "s|--main-bg-color:.*|--main-bg-color: black;|g" "$filename"
  129. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #030202;|g" "$filename"
  130. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #050202;|g" "$filename"
  131. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  132. sed -i "s|--main-fg-color:.*|--main-fg-color: green;|g" "$filename"
  133. sed -i "s|--border-color:.*|--border-color: darkgreen;|g" "$filename"
  134. sed -i "s|--main-link-color:.*|--main-link-color: #266020;|g" "$filename"
  135. sed -i "s|--main-visited-color:.*|--main-visited-color: #3c8234;|g" "$filename"
  136. sed -i "s|--button-selected:.*|--button-selected: #063200;|g" "$filename"
  137. sed -i "s|--button-background:.*|--button-background: #062200;|g" "$filename"
  138. sed -i "s|--button-text:.*|--button-text: green;|g" "$filename"
  139. sed -i "s|font-family:.*|font-family: Courier;|g" "$filename"
  140. sed -i "s|background-color: #554;|background-color: #062200;|g" "$filename"
  141. sed -i "s|color: #FFFFFE;|color: green;|g" "$filename"
  142. cp epicyon-follow.css follow.css
  143. filename=follow.css
  144. sed -i "s|--main-bg-color:.*|--main-bg-color: black;|g" "$filename"
  145. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #030202;|g" "$filename"
  146. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #050202;|g" "$filename"
  147. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  148. sed -i "s|--main-fg-color:.*|--main-fg-color: green;|g" "$filename"
  149. sed -i "s|--border-color:.*|--border-color: darkgreen;|g" "$filename"
  150. sed -i "s|--main-link-color:.*|--main-link-color: #266020;|g" "$filename"
  151. sed -i "s|--main-visited-color:.*|--main-visited-color: #3c8234;|g" "$filename"
  152. sed -i "s|--button-selected:.*|--button-selected: #063200;|g" "$filename"
  153. sed -i "s|--button-background:.*|--button-background: #062200;|g" "$filename"
  154. sed -i "s|--button-text:.*|--button-text: green;|g" "$filename"
  155. sed -i "s|font-family:.*|font-family: Courier;|g" "$filename"
  156. sed -i "s|background-color: #554;|background-color: #062200;|g" "$filename"
  157. sed -i "s|color: #FFFFFE;|color: green;|g" "$filename"
  158. cp epicyon-suspended.css suspended.css
  159. filename=suspended.css
  160. sed -i "s|--main-bg-color:.*|--main-bg-color: black;|g" "$filename"
  161. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #030202;|g" "$filename"
  162. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #050202;|g" "$filename"
  163. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #1f192d;|g" "$filename"
  164. sed -i "s|--main-fg-color:.*|--main-fg-color: green;|g" "$filename"
  165. sed -i "s|--border-color:.*|--border-color: darkgreen;|g" "$filename"
  166. sed -i "s|--main-link-color:.*|--main-link-color: #266020;|g" "$filename"
  167. sed -i "s|--main-visited-color:.*|--main-visited-color: #3c8234;|g" "$filename"
  168. sed -i "s|--button-selected:.*|--button-selected: #063200;|g" "$filename"
  169. sed -i "s|--button-background:.*|--button-background: #062200;|g" "$filename"
  170. sed -i "s|--button-text:.*|--button-text: green;|g" "$filename"
  171. sed -i "s|font-family:.*|font-family: Courier;|g" "$filename"
  172. sed -i "s|background-color: #554;|background-color: #062200;|g" "$filename"
  173. sed -i "s|color: #FFFFFE;|color: green;|g" "$filename"
  174. fi
  175. if [[ "$themeName" == 'light'* ]]; then
  176. if [ -f config.json ]; then
  177. if grep -q '"theme"' config.json; then
  178. sed -i '/"theme"/d' config.json
  179. fi
  180. fi
  181. cp epicyon-profile.css epicyon.css
  182. filename=epicyon.css
  183. sed -i "s|--main-bg-color:.*|--main-bg-color: #e6ebf0;|g" "$filename"
  184. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #e0dbf0;|g" "$filename"
  185. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #e3dbf0;|g" "$filename"
  186. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #ebebf0;|g" "$filename"
  187. sed -i "s|--main-fg-color:.*|--main-fg-color: #2d2c37;|g" "$filename"
  188. sed -i "s|--border-color:.*|--border-color: #c0cdd9;|g" "$filename"
  189. sed -i "s|--main-link-color:.*|--main-link-color: #2a2c37;|g" "$filename"
  190. sed -i "s|--main-visited-color:.*|--main-visited-color: #232c37;|g" "$filename"
  191. sed -i "s|background-color: #554;|background-color: white;|g" "$filename"
  192. sed -i "s|color: #FFFFFE;|color: black;|g" "$filename"
  193. cp epicyon-login.css login.css
  194. filename=login.css
  195. sed -i "s|--main-bg-color:.*|--main-bg-color: #e6ebf0;|g" "$filename"
  196. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #e0dbf0;|g" "$filename"
  197. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #e3dbf0;|g" "$filename"
  198. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #ebebf0;|g" "$filename"
  199. sed -i "s|--main-fg-color:.*|--main-fg-color: #2d2c37;|g" "$filename"
  200. sed -i "s|--border-color:.*|--border-color: #c0cdd9;|g" "$filename"
  201. sed -i "s|--main-link-color:.*|--main-link-color: #2a2c37;|g" "$filename"
  202. sed -i "s|--main-visited-color:.*|--main-visited-color: #232c37;|g" "$filename"
  203. sed -i "s|background-color: #554;|background-color: white;|g" "$filename"
  204. sed -i "s|color: #FFFFFE;|color: black;|g" "$filename"
  205. cp epicyon-follow.css follow.css
  206. filename=follow.css
  207. sed -i "s|--main-bg-color:.*|--main-bg-color: #e6ebf0;|g" "$filename"
  208. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #e0dbf0;|g" "$filename"
  209. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #e3dbf0;|g" "$filename"
  210. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #ebebf0;|g" "$filename"
  211. sed -i "s|--main-fg-color:.*|--main-fg-color: #2d2c37;|g" "$filename"
  212. sed -i "s|--border-color:.*|--border-color: #c0cdd9;|g" "$filename"
  213. sed -i "s|--main-link-color:.*|--main-link-color: #2a2c37;|g" "$filename"
  214. sed -i "s|--main-visited-color:.*|--main-visited-color: #232c37;|g" "$filename"
  215. sed -i "s|background-color: #554;|background-color: white;|g" "$filename"
  216. sed -i "s|color: #FFFFFE;|color: black;|g" "$filename"
  217. cp epicyon-suspended.css suspended.css
  218. filename=suspended.css
  219. sed -i "s|--main-bg-color:.*|--main-bg-color: #e6ebf0;|g" "$filename"
  220. sed -i "s|--main-bg-color-reply:.*|--main-bg-color-reply: #e0dbf0;|g" "$filename"
  221. sed -i "s|--main-bg-color-report:.*|--main-bg-color-report: #e3dbf0;|g" "$filename"
  222. sed -i "s|--main-header-color-roles:.*|--main-header-color-roles: #ebebf0;|g" "$filename"
  223. sed -i "s|--main-fg-color:.*|--main-fg-color: #2d2c37;|g" "$filename"
  224. sed -i "s|--border-color:.*|--border-color: #c0cdd9;|g" "$filename"
  225. sed -i "s|--main-link-color:.*|--main-link-color: #2a2c37;|g" "$filename"
  226. sed -i "s|--main-visited-color:.*|--main-visited-color: #232c37;|g" "$filename"
  227. sed -i "s|background-color: #554;|background-color: white;|g" "$filename"
  228. sed -i "s|color: #FFFFFE;|color: black;|g" "$filename"
  229. fi