karnel-termux 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +454 -0
  3. package/install.sh +272 -0
  4. package/karnel/bin/karnel +77 -0
  5. package/karnel/cli/commands/brain.sh +1553 -0
  6. package/karnel/cli/commands/cleanup.sh +66 -0
  7. package/karnel/cli/commands/doctor.sh +1528 -0
  8. package/karnel/cli/commands/env.sh +233 -0
  9. package/karnel/cli/commands/help.sh +8 -0
  10. package/karnel/cli/commands/ia.sh +502 -0
  11. package/karnel/cli/commands/init.sh +1274 -0
  12. package/karnel/cli/commands/install.sh +718 -0
  13. package/karnel/cli/commands/list.sh +399 -0
  14. package/karnel/cli/commands/open.sh +106 -0
  15. package/karnel/cli/commands/pg.sh +719 -0
  16. package/karnel/cli/commands/reinstall.sh +663 -0
  17. package/karnel/cli/commands/show.sh +90 -0
  18. package/karnel/cli/commands/start.sh +54 -0
  19. package/karnel/cli/commands/status.sh +96 -0
  20. package/karnel/cli/commands/uninstall.sh +668 -0
  21. package/karnel/cli/commands/update.sh +723 -0
  22. package/karnel/cli/commands/upgrade.sh +40 -0
  23. package/karnel/cli/commands/version.sh +3 -0
  24. package/karnel/cli/commands/voice.sh +230 -0
  25. package/karnel/cli/karnel.sh +706 -0
  26. package/karnel/modules/ai.sh +135 -0
  27. package/karnel/modules/auto.sh +114 -0
  28. package/karnel/modules/db.sh +132 -0
  29. package/karnel/modules/deploy.sh +74 -0
  30. package/karnel/modules/dev.sh +148 -0
  31. package/karnel/modules/editor.sh +115 -0
  32. package/karnel/modules/lang.sh +124 -0
  33. package/karnel/modules/npm.sh +146 -0
  34. package/karnel/modules/shell.sh +338 -0
  35. package/karnel/modules/ui.sh +139 -0
  36. package/karnel/modules/voice.sh +118 -0
  37. package/karnel/tools/ai/all.sh +209 -0
  38. package/karnel/tools/ai/antigravity-cli/README.md +45 -0
  39. package/karnel/tools/ai/antigravity-cli/bin/agy +28 -0
  40. package/karnel/tools/ai/antigravity-cli/helper/agy_helper.c +39 -0
  41. package/karnel/tools/ai/antigravity-cli/install.sh +469 -0
  42. package/karnel/tools/ai/claude-code/README.md +45 -0
  43. package/karnel/tools/ai/claude-code/bin/claude +29 -0
  44. package/karnel/tools/ai/claude-code/helper/claude_helper.c +42 -0
  45. package/karnel/tools/ai/claude-code/install.sh +278 -0
  46. package/karnel/tools/ai/cline/install.sh +160 -0
  47. package/karnel/tools/ai/codegraph/README.md +43 -0
  48. package/karnel/tools/ai/codegraph/bin/codegraph +5 -0
  49. package/karnel/tools/ai/codegraph/install.sh +160 -0
  50. package/karnel/tools/ai/codex/README.md +44 -0
  51. package/karnel/tools/ai/codex/install.sh +104 -0
  52. package/karnel/tools/ai/command-code/README.md +62 -0
  53. package/karnel/tools/ai/command-code/install.sh +136 -0
  54. package/karnel/tools/ai/crush/README.md +17 -0
  55. package/karnel/tools/ai/crush/install.sh +89 -0
  56. package/karnel/tools/ai/ctx7/README.md +26 -0
  57. package/karnel/tools/ai/ctx7/install.sh +61 -0
  58. package/karnel/tools/ai/engram/README.md +44 -0
  59. package/karnel/tools/ai/engram/install.sh +127 -0
  60. package/karnel/tools/ai/freebuff/README.md +52 -0
  61. package/karnel/tools/ai/freebuff/bin/freebuff +28 -0
  62. package/karnel/tools/ai/freebuff/helper/freebuff_helper.c +47 -0
  63. package/karnel/tools/ai/freebuff/install.sh +303 -0
  64. package/karnel/tools/ai/gemini-cli/README.md +46 -0
  65. package/karnel/tools/ai/gemini-cli/install.sh +111 -0
  66. package/karnel/tools/ai/gentle-ai/README.md +42 -0
  67. package/karnel/tools/ai/gentle-ai/install.sh +253 -0
  68. package/karnel/tools/ai/gentle-ai/termux-patches.go +256 -0
  69. package/karnel/tools/ai/gga/README.md +49 -0
  70. package/karnel/tools/ai/gga/install.sh +134 -0
  71. package/karnel/tools/ai/hermes-agent/README.md +50 -0
  72. package/karnel/tools/ai/hermes-agent/install.sh +120 -0
  73. package/karnel/tools/ai/kilocode-cli/README.md +45 -0
  74. package/karnel/tools/ai/kilocode-cli/bin/kilocode +21 -0
  75. package/karnel/tools/ai/kilocode-cli/helper/kilocode_helper.c +47 -0
  76. package/karnel/tools/ai/kilocode-cli/install.sh +179 -0
  77. package/karnel/tools/ai/kimchi-code/README.md +53 -0
  78. package/karnel/tools/ai/kimchi-code/install.sh +221 -0
  79. package/karnel/tools/ai/kimi-code/README.md +45 -0
  80. package/karnel/tools/ai/kimi-code/install.sh +111 -0
  81. package/karnel/tools/ai/kiro/README.md +17 -0
  82. package/karnel/tools/ai/kiro/install.sh +134 -0
  83. package/karnel/tools/ai/mimocode/README.md +43 -0
  84. package/karnel/tools/ai/mimocode/bin/mimo +28 -0
  85. package/karnel/tools/ai/mimocode/helper/mimocode_helper.c +47 -0
  86. package/karnel/tools/ai/mimocode/install.sh +287 -0
  87. package/karnel/tools/ai/minimax-cli/README.md +45 -0
  88. package/karnel/tools/ai/minimax-cli/install.sh +111 -0
  89. package/karnel/tools/ai/mistral-vibe/README.md +46 -0
  90. package/karnel/tools/ai/mistral-vibe/install.sh +119 -0
  91. package/karnel/tools/ai/odysseus/README.md +35 -0
  92. package/karnel/tools/ai/odysseus/install.sh +198 -0
  93. package/karnel/tools/ai/ollama/README.md +44 -0
  94. package/karnel/tools/ai/ollama/install.sh +78 -0
  95. package/karnel/tools/ai/omni-route/README.md +111 -0
  96. package/karnel/tools/ai/omni-route/install.sh +165 -0
  97. package/karnel/tools/ai/openclaude/README.md +46 -0
  98. package/karnel/tools/ai/openclaude/install.sh +110 -0
  99. package/karnel/tools/ai/openclaw/README.md +47 -0
  100. package/karnel/tools/ai/openclaw/install.sh +112 -0
  101. package/karnel/tools/ai/opencode/README.md +51 -0
  102. package/karnel/tools/ai/opencode/bin/opencode +28 -0
  103. package/karnel/tools/ai/opencode/helper/opencode_helper.c +57 -0
  104. package/karnel/tools/ai/opencode/install.sh +290 -0
  105. package/karnel/tools/ai/openspec/README.md +34 -0
  106. package/karnel/tools/ai/openspec/install.sh +61 -0
  107. package/karnel/tools/ai/pi/README.md +46 -0
  108. package/karnel/tools/ai/pi/install.sh +104 -0
  109. package/karnel/tools/ai/qwen-code/README.md +45 -0
  110. package/karnel/tools/ai/qwen-code/install.sh +111 -0
  111. package/karnel/tools/auto/all.sh +57 -0
  112. package/karnel/tools/auto/n8n/README.md +47 -0
  113. package/karnel/tools/auto/n8n/install.sh +102 -0
  114. package/karnel/tools/db/all.sh +61 -0
  115. package/karnel/tools/db/mariadb/README.md +43 -0
  116. package/karnel/tools/db/mariadb/install.sh +65 -0
  117. package/karnel/tools/db/mongodb/README.md +42 -0
  118. package/karnel/tools/db/mongodb/install.sh +73 -0
  119. package/karnel/tools/db/postgresql/README.md +45 -0
  120. package/karnel/tools/db/postgresql/install.sh +65 -0
  121. package/karnel/tools/db/redis/README.md +46 -0
  122. package/karnel/tools/db/redis/install.sh +64 -0
  123. package/karnel/tools/db/sqlite/README.md +44 -0
  124. package/karnel/tools/db/sqlite/install.sh +65 -0
  125. package/karnel/tools/deploy/all.sh +43 -0
  126. package/karnel/tools/deploy/netlify/install.sh +41 -0
  127. package/karnel/tools/deploy/railway/install.sh +109 -0
  128. package/karnel/tools/deploy/vercel/install.sh +43 -0
  129. package/karnel/tools/dev/all.sh +77 -0
  130. package/karnel/tools/dev/bat/README.md +44 -0
  131. package/karnel/tools/dev/bat/install.sh +82 -0
  132. package/karnel/tools/dev/bc/README.md +44 -0
  133. package/karnel/tools/dev/bc/install.sh +82 -0
  134. package/karnel/tools/dev/cloudflared/README.md +43 -0
  135. package/karnel/tools/dev/cloudflared/install.sh +82 -0
  136. package/karnel/tools/dev/curl/README.md +43 -0
  137. package/karnel/tools/dev/curl/install.sh +82 -0
  138. package/karnel/tools/dev/fzf/README.md +44 -0
  139. package/karnel/tools/dev/fzf/install.sh +82 -0
  140. package/karnel/tools/dev/gh/README.md +43 -0
  141. package/karnel/tools/dev/gh/install.sh +82 -0
  142. package/karnel/tools/dev/html2text/README.md +44 -0
  143. package/karnel/tools/dev/html2text/install.sh +82 -0
  144. package/karnel/tools/dev/imagemagick/README.md +44 -0
  145. package/karnel/tools/dev/imagemagick/install.sh +82 -0
  146. package/karnel/tools/dev/jq/README.md +44 -0
  147. package/karnel/tools/dev/jq/install.sh +82 -0
  148. package/karnel/tools/dev/lsd/README.md +44 -0
  149. package/karnel/tools/dev/lsd/install.sh +82 -0
  150. package/karnel/tools/dev/make/README.md +44 -0
  151. package/karnel/tools/dev/make/install.sh +82 -0
  152. package/karnel/tools/dev/ncurses/README.md +42 -0
  153. package/karnel/tools/dev/ncurses/install.sh +82 -0
  154. package/karnel/tools/dev/openssh/README.md +43 -0
  155. package/karnel/tools/dev/openssh/install.sh +75 -0
  156. package/karnel/tools/dev/proot/README.md +43 -0
  157. package/karnel/tools/dev/proot/install.sh +82 -0
  158. package/karnel/tools/dev/shfmt/README.md +44 -0
  159. package/karnel/tools/dev/shfmt/install.sh +82 -0
  160. package/karnel/tools/dev/tmate/README.md +44 -0
  161. package/karnel/tools/dev/tmate/install.sh +82 -0
  162. package/karnel/tools/dev/tmux/README.md +43 -0
  163. package/karnel/tools/dev/tmux/install.sh +75 -0
  164. package/karnel/tools/dev/translate/README.md +44 -0
  165. package/karnel/tools/dev/translate/install.sh +82 -0
  166. package/karnel/tools/dev/tree/README.md +44 -0
  167. package/karnel/tools/dev/tree/install.sh +82 -0
  168. package/karnel/tools/dev/udocker/README.md +44 -0
  169. package/karnel/tools/dev/udocker/install.sh +82 -0
  170. package/karnel/tools/dev/wget/README.md +44 -0
  171. package/karnel/tools/dev/wget/install.sh +82 -0
  172. package/karnel/tools/editor/all.sh +59 -0
  173. package/karnel/tools/editor/code-server/README.md +42 -0
  174. package/karnel/tools/editor/code-server/install.sh +74 -0
  175. package/karnel/tools/editor/neovim/README.md +43 -0
  176. package/karnel/tools/editor/neovim/install.sh +64 -0
  177. package/karnel/tools/editor/nvchad/README.md +45 -0
  178. package/karnel/tools/editor/nvchad/install.sh +105 -0
  179. package/karnel/tools/lang/all.sh +63 -0
  180. package/karnel/tools/lang/clang/README.md +43 -0
  181. package/karnel/tools/lang/clang/install.sh +79 -0
  182. package/karnel/tools/lang/golang/README.md +43 -0
  183. package/karnel/tools/lang/golang/install.sh +79 -0
  184. package/karnel/tools/lang/nodejs/README.md +43 -0
  185. package/karnel/tools/lang/nodejs/install.sh +79 -0
  186. package/karnel/tools/lang/perl/README.md +43 -0
  187. package/karnel/tools/lang/perl/install.sh +79 -0
  188. package/karnel/tools/lang/php/README.md +43 -0
  189. package/karnel/tools/lang/php/install.sh +79 -0
  190. package/karnel/tools/lang/python/README.md +43 -0
  191. package/karnel/tools/lang/python/install.sh +79 -0
  192. package/karnel/tools/lang/rust/README.md +43 -0
  193. package/karnel/tools/lang/rust/install.sh +79 -0
  194. package/karnel/tools/npm/all.sh +90 -0
  195. package/karnel/tools/npm/live-server/README.md +43 -0
  196. package/karnel/tools/npm/live-server/install.sh +96 -0
  197. package/karnel/tools/npm/localtunnel/README.md +43 -0
  198. package/karnel/tools/npm/localtunnel/install.sh +112 -0
  199. package/karnel/tools/npm/markserv/README.md +43 -0
  200. package/karnel/tools/npm/markserv/install.sh +95 -0
  201. package/karnel/tools/npm/ncu/README.md +43 -0
  202. package/karnel/tools/npm/ncu/install.sh +95 -0
  203. package/karnel/tools/npm/nestjs/README.md +43 -0
  204. package/karnel/tools/npm/nestjs/install.sh +95 -0
  205. package/karnel/tools/npm/ngrok/README.md +44 -0
  206. package/karnel/tools/npm/ngrok/install.sh +95 -0
  207. package/karnel/tools/npm/prettier/README.md +43 -0
  208. package/karnel/tools/npm/prettier/install.sh +95 -0
  209. package/karnel/tools/npm/psqlformat/README.md +43 -0
  210. package/karnel/tools/npm/psqlformat/install.sh +95 -0
  211. package/karnel/tools/npm/turbopack/README.md +8 -0
  212. package/karnel/tools/npm/turbopack/install.sh +42 -0
  213. package/karnel/tools/npm/typescript/README.md +43 -0
  214. package/karnel/tools/npm/typescript/install.sh +95 -0
  215. package/karnel/tools/npm/vercel/README.md +43 -0
  216. package/karnel/tools/npm/vercel/install.sh +95 -0
  217. package/karnel/tools/shell/all.sh +67 -0
  218. package/karnel/tools/shell/better-npm/README.md +43 -0
  219. package/karnel/tools/shell/better-npm/install.sh +85 -0
  220. package/karnel/tools/shell/fzf-tab/README.md +44 -0
  221. package/karnel/tools/shell/fzf-tab/install.sh +85 -0
  222. package/karnel/tools/shell/history-substring/README.md +43 -0
  223. package/karnel/tools/shell/history-substring/install.sh +85 -0
  224. package/karnel/tools/shell/powerlevel10k/README.md +43 -0
  225. package/karnel/tools/shell/powerlevel10k/install.sh +85 -0
  226. package/karnel/tools/shell/you-should-use/README.md +43 -0
  227. package/karnel/tools/shell/you-should-use/install.sh +85 -0
  228. package/karnel/tools/shell/zsh-autopair/README.md +44 -0
  229. package/karnel/tools/shell/zsh-autopair/install.sh +85 -0
  230. package/karnel/tools/shell/zsh-autosuggestions/README.md +43 -0
  231. package/karnel/tools/shell/zsh-autosuggestions/install.sh +85 -0
  232. package/karnel/tools/shell/zsh-completions/README.md +43 -0
  233. package/karnel/tools/shell/zsh-completions/install.sh +85 -0
  234. package/karnel/tools/shell/zsh-defer/README.md +43 -0
  235. package/karnel/tools/shell/zsh-defer/install.sh +85 -0
  236. package/karnel/tools/shell/zsh-syntax-highlighting/README.md +43 -0
  237. package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +72 -0
  238. package/karnel/tools/ui/all.sh +61 -0
  239. package/karnel/tools/ui/banner/README.md +42 -0
  240. package/karnel/tools/ui/banner/install.sh +160 -0
  241. package/karnel/tools/ui/cursor/README.md +42 -0
  242. package/karnel/tools/ui/cursor/install.sh +58 -0
  243. package/karnel/tools/ui/extra-keys/README.md +43 -0
  244. package/karnel/tools/ui/extra-keys/install.sh +62 -0
  245. package/karnel/tools/ui/font/README.md +43 -0
  246. package/karnel/tools/ui/font/install.sh +63 -0
  247. package/karnel/tools/voice/all.sh +27 -0
  248. package/karnel/tools/voice/install.sh +10 -0
  249. package/karnel/tools/voice/uninstall.sh +8 -0
  250. package/karnel/utils/banner.sh +492 -0
  251. package/karnel/utils/bootstrap.sh +25 -0
  252. package/karnel/utils/colors.sh +33 -0
  253. package/karnel/utils/dialogrc +30 -0
  254. package/karnel/utils/env.sh +53 -0
  255. package/karnel/utils/log.sh +567 -0
  256. package/karnel/utils/version.sh +205 -0
  257. package/package.json +42 -0
  258. package/scripts/npm-install.js +60 -0
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_shell.log"
6
+ ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
7
+
8
+ _zsh_completions_dependencies() {
9
+ declare -A DEPS=(
10
+ ["zsh"]="zsh"
11
+ ["zoxide"]="zoxide"
12
+ ["git"]="git"
13
+ )
14
+
15
+ local pkg_name bin_name
16
+ for pkg_name in "${!DEPS[@]}"; do
17
+ bin_name="${DEPS[$pkg_name]}"
18
+ if ! command -v "$bin_name" &>/dev/null; then
19
+ if ! pkg install "$pkg_name" -y &>>"$LOG_FILE"; then
20
+ log_error "Failed to install $pkg_name"
21
+ return 1
22
+ fi
23
+ fi
24
+ done
25
+
26
+ log_success "Shell dependencies installed"
27
+ return 0
28
+ }
29
+
30
+ _install_zsh_completions_git() {
31
+ loading "Installing zsh-completions" _install_zsh_completions_git_impl
32
+ }
33
+
34
+ _install_zsh_completions_git_impl() {
35
+ mkdir -p "$(dirname "$LOG_FILE")"
36
+ if ! git clone --depth=1 "https://github.com/zsh-users/zsh-completions.git" "$ZSH_PLUGINS_DIR/zsh-completions" &>>"$LOG_FILE"; then
37
+ log_error "Failed to install zsh-completions"
38
+ return 1
39
+ fi
40
+ return 0
41
+ }
42
+
43
+ install_zsh_completions() {
44
+ if [[ -d "$ZSH_PLUGINS_DIR/zsh-completions" ]]; then
45
+ log_info "zsh-completions already installed"
46
+ return 0
47
+ fi
48
+
49
+ _zsh_completions_dependencies
50
+
51
+ _install_zsh_completions_git || return 1
52
+ log_success "Installed"
53
+ return 0
54
+ }
55
+
56
+ _uninstall_zsh_completions_impl() {
57
+ if [[ ! -d "$ZSH_PLUGINS_DIR/zsh-completions" ]]; then
58
+ log_info "zsh-completions is not installed"
59
+ return 0
60
+ fi
61
+
62
+ rm -rf "$ZSH_PLUGINS_DIR/zsh-completions"
63
+ }
64
+
65
+ uninstall_zsh_completions() {
66
+ loading "Uninstalling zsh-completions" _uninstall_zsh_completions_impl
67
+ }
68
+
69
+ _update_zsh_completions_impl() {
70
+ if [[ ! -d "$ZSH_PLUGINS_DIR/zsh-completions/.git" ]]; then
71
+ log_warn "zsh-completions not installed"
72
+ return 0
73
+ fi
74
+
75
+ git -C "$ZSH_PLUGINS_DIR/zsh-completions" pull &>>"$LOG_FILE"
76
+ }
77
+
78
+ update_zsh_completions() {
79
+ loading "Updating zsh-completions" _update_zsh_completions_impl
80
+ }
81
+
82
+ reinstall_zsh_completions() {
83
+ uninstall_zsh_completions
84
+ install_zsh_completions
85
+ }
@@ -0,0 +1,43 @@
1
+ # Zsh-defer
2
+
3
+ Deferred plugin loading for faster ZSH startup
4
+
5
+ **Package:** zsh-defer
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://github.com/romkatv/zsh-defer
9
+ **Type:** ZSH plugin (git clone)
10
+ **License:** MIT
11
+
12
+ ## Description
13
+
14
+ Zsh-defer defers the loading of ZSH plugins to after the first prompt, significantly improving shell startup time. Non-essential plugins are loaded in the background while the shell remains responsive.
15
+
16
+ ## Dependencies
17
+
18
+ - ZSH, git, zoxide
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install shell --zsh-defer
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall shell --zsh-defer
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update shell --zsh-defer
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Installed in `~/.zsh-plugins/`
41
+ - Delays plugin loading until after first prompt
42
+ - Improves perceived ZSH startup time
43
+
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_shell.log"
6
+ ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
7
+
8
+ _zsh_defer_dependencies() {
9
+ declare -A DEPS=(
10
+ ["zsh"]="zsh"
11
+ ["zoxide"]="zoxide"
12
+ ["git"]="git"
13
+ )
14
+
15
+ local pkg_name bin_name
16
+ for pkg_name in "${!DEPS[@]}"; do
17
+ bin_name="${DEPS[$pkg_name]}"
18
+ if ! command -v "$bin_name" &>/dev/null; then
19
+ if ! pkg install "$pkg_name" -y &>>"$LOG_FILE"; then
20
+ log_error "Failed to install $pkg_name"
21
+ return 1
22
+ fi
23
+ fi
24
+ done
25
+
26
+ log_success "Shell dependencies installed"
27
+ return 0
28
+ }
29
+
30
+ _install_zsh_defer_git() {
31
+ loading "Installing zsh-defer" _install_zsh_defer_git_impl
32
+ }
33
+
34
+ _install_zsh_defer_git_impl() {
35
+ mkdir -p "$(dirname "$LOG_FILE")"
36
+ if ! git clone --depth=1 "https://github.com/romkatv/zsh-defer.git" "$ZSH_PLUGINS_DIR/zsh-defer" &>>"$LOG_FILE"; then
37
+ log_error "Failed to install zsh-defer"
38
+ return 1
39
+ fi
40
+ return 0
41
+ }
42
+
43
+ install_zsh_defer() {
44
+ if [[ -d "$ZSH_PLUGINS_DIR/zsh-defer" ]]; then
45
+ log_info "zsh-defer already installed"
46
+ return 0
47
+ fi
48
+
49
+ _zsh_defer_dependencies
50
+
51
+ _install_zsh_defer_git || return 1
52
+ log_success "Installed"
53
+ return 0
54
+ }
55
+
56
+ _uninstall_zsh_defer_impl() {
57
+ if [[ ! -d "$ZSH_PLUGINS_DIR/zsh-defer" ]]; then
58
+ log_info "zsh-defer is not installed"
59
+ return 2
60
+ fi
61
+
62
+ rm -rf "$ZSH_PLUGINS_DIR/zsh-defer"
63
+ }
64
+
65
+ uninstall_zsh_defer() {
66
+ loading "Uninstalling zsh-defer" _uninstall_zsh_defer_impl
67
+ }
68
+
69
+ _update_zsh_defer_impl() {
70
+ if [[ ! -d "$ZSH_PLUGINS_DIR/zsh-defer/.git" ]]; then
71
+ log_warn "zsh-defer not installed"
72
+ return 0
73
+ fi
74
+
75
+ git -C "$ZSH_PLUGINS_DIR/zsh-defer" pull &>>"$LOG_FILE"
76
+ }
77
+
78
+ update_zsh_defer() {
79
+ loading "Updating zsh-defer" _update_zsh_defer_impl
80
+ }
81
+
82
+ reinstall_zsh_defer() {
83
+ uninstall_zsh_defer
84
+ install_zsh_defer
85
+ }
@@ -0,0 +1,43 @@
1
+ # Zsh-syntax-highlighting
2
+
3
+ Real-time syntax highlighting for ZSH commands
4
+
5
+ **Package:** zsh-syntax-highlighting
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://github.com/zsh-users/zsh-syntax-highlighting
9
+ **Type:** ZSH plugin (git clone)
10
+ **License:** BSD 3-Clause
11
+
12
+ ## Description
13
+
14
+ Zsh-syntax-highlighting provides real-time syntax highlighting for commands as you type in ZSH. Valid commands are highlighted in green, invalid in red, and various tokens get different colors for better readability.
15
+
16
+ ## Dependencies
17
+
18
+ - ZSH, git, zoxide
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install shell --zsh-syntax-highlighting
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall shell --zsh-syntax-highlighting
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update shell --zsh-syntax-highlighting
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Installed in `~/.zsh-plugins/`
41
+ - Highlights commands in real-time
42
+ - Must be loaded last in plugin order
43
+
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_shell.log"
6
+ ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
7
+
8
+ _zsh_syntax_highlighting_dependencies() {
9
+ if command -v git &>/dev/null && command -v zsh &>/dev/null; then
10
+ return 0
11
+ fi
12
+
13
+ mkdir -p "$(dirname "$LOG_FILE")"
14
+ pkg install zsh zoxide git -y &>>"$LOG_FILE"
15
+ }
16
+
17
+ _install_zsh_syntax_highlighting_git() {
18
+ loading "Installing zsh-syntax-highlighting" _install_zsh_syntax_highlighting_git_impl
19
+ }
20
+
21
+ _install_zsh_syntax_highlighting_git_impl() {
22
+ mkdir -p "$(dirname "$LOG_FILE")"
23
+ if ! git clone --depth=1 "https://github.com/zsh-users/zsh-syntax-highlighting.git" "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting" &>>"$LOG_FILE"; then
24
+ log_error "Failed to install zsh-syntax-highlighting"
25
+ return 1
26
+ fi
27
+ return 0
28
+ }
29
+
30
+ install_zsh_syntax_highlighting() {
31
+ if [[ -d "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting" ]]; then
32
+ log_info "zsh-syntax-highlighting already installed"
33
+ return 0
34
+ fi
35
+
36
+ _zsh_syntax_highlighting_dependencies
37
+
38
+ _install_zsh_syntax_highlighting_git || return 1
39
+ log_success "Installed"
40
+ return 0
41
+ }
42
+
43
+ _uninstall_zsh_syntax_highlighting_impl() {
44
+ if [[ ! -d "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting" ]]; then
45
+ log_info "zsh-syntax-highlighting is not installed"
46
+ return 0
47
+ fi
48
+
49
+ rm -rf "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting"
50
+ }
51
+
52
+ uninstall_zsh_syntax_highlighting() {
53
+ loading "Uninstalling zsh-syntax-highlighting" _uninstall_zsh_syntax_highlighting_impl
54
+ }
55
+
56
+ _update_zsh_syntax_highlighting_impl() {
57
+ if [[ ! -d "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting/.git" ]]; then
58
+ log_warn "zsh-syntax-highlighting not installed"
59
+ return 0
60
+ fi
61
+
62
+ git -C "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting" pull &>>"$LOG_FILE"
63
+ }
64
+
65
+ update_zsh_syntax_highlighting() {
66
+ loading "Updating zsh-syntax-highlighting" _update_zsh_syntax_highlighting_impl
67
+ }
68
+
69
+ reinstall_zsh_syntax_highlighting() {
70
+ uninstall_zsh_syntax_highlighting
71
+ install_zsh_syntax_highlighting
72
+ }
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_ui.log"
6
+ TERMUX_DIR="$HOME/.termux"
7
+
8
+ UI_COMPONENTS=(
9
+ "font"
10
+ "extra-keys"
11
+ "cursor"
12
+ "banner"
13
+ )
14
+
15
+ for _tool in "${UI_COMPONENTS[@]}"; do
16
+ source "$(dirname "$BASH_SOURCE")/$_tool/install.sh"
17
+ done
18
+ unset _tool
19
+
20
+ _batch_ui() {
21
+ local action="$1"
22
+ local action_past="$2"
23
+ local count_var="$3"
24
+ local count=0
25
+ local failed=0
26
+ local total=${#UI_COMPONENTS[@]}
27
+ local current=0
28
+ local func_name
29
+
30
+ progress_start "$total" "${action_past}ing UI components..."
31
+
32
+ for tool in "${UI_COMPONENTS[@]}"; do
33
+ func_name="${action}_${tool//-/_}"
34
+ if declare -f "$func_name" &>/dev/null; then
35
+ loading "${action_past^}ing ${tool}" "$func_name"
36
+ case $? in 0) ((count++));; 1) ((failed++));; esac
37
+ fi
38
+ ((current++))
39
+ progress_update "$current" "$total"
40
+ done
41
+
42
+ progress_done "$total"
43
+ eval "$count_var=$count"
44
+ return $failed
45
+ }
46
+
47
+ install_all_ui_components() {
48
+ _batch_ui "install" "install" "installed_count"
49
+ }
50
+
51
+ uninstall_all_ui_components() {
52
+ _batch_ui "uninstall" "uninstall" "uninstalled_count"
53
+ }
54
+
55
+ update_all_ui_components() {
56
+ _batch_ui "update" "update" "updated_count"
57
+ }
58
+
59
+ reinstall_all_ui_components() {
60
+ _batch_ui "reinstall" "reinstall" "reinstalled_count"
61
+ }
@@ -0,0 +1,42 @@
1
+ # Banner Configuration for Termux
2
+
3
+ Customize Termux with Karnel Termux Banner
4
+
5
+ **Package:** karnel-termux (banner config)
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Type:** Termux UI customization
9
+ **License:** MIT
10
+
11
+ ## Description
12
+
13
+ Configure a custom banner for Termux using Karnel Termux. This package allows you to set a personalized welcome message that appears when you start Termux, enhancing your terminal experience.
14
+
15
+ ## Dependencies
16
+
17
+ - Termux (base installation)
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ karnel install ui --banner
23
+ ```
24
+
25
+ ## Uninstall
26
+
27
+ ```bash
28
+ karnel uninstall ui --banner
29
+ ```
30
+
31
+ ## Update
32
+
33
+ ```bash
34
+ karnel update ui --banner
35
+ ```
36
+
37
+ ## Notes
38
+
39
+ - Source file: `~/.local/share/karnel/assets/banner/karnel.txt`
40
+ - removes Termux welcome message: motd
41
+ - Restart Termux to apply changes
42
+
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_ui.log"
6
+
7
+ KARNEL_BANNER_MARKER="# ===== Karnel Banner ====="
8
+ KARNEL_MOTD_BACKUP="$KARNEL_CACHE/motd.backup"
9
+
10
+ _backup_motd() {
11
+ if [[ ! -e "$PREFIX/etc/motd" ]]; then
12
+ return 0
13
+ fi
14
+
15
+ if [[ -e "$KARNEL_MOTD_BACKUP" ]]; then
16
+ log_info "Termux MOTD already backed up"
17
+ return 0
18
+ fi
19
+
20
+ log_info "Backing up Termux MOTD..."
21
+ mv "$PREFIX/etc/motd" "$KARNEL_MOTD_BACKUP"
22
+ log_success "Termux MOTD backed up to $KARNEL_MOTD_BACKUP"
23
+ }
24
+
25
+ _restore_motd() {
26
+ if [[ ! -e "$KARNEL_MOTD_BACKUP" ]]; then
27
+ return 0
28
+ fi
29
+
30
+ if [[ -e "$PREFIX/etc/motd" ]]; then
31
+ log_warn "Termux MOTD already exists, skipping restore"
32
+ return 0
33
+ fi
34
+
35
+ log_info "Restoring Termux MOTD..."
36
+ mv "$KARNEL_MOTD_BACKUP" "$PREFIX/etc/motd"
37
+ log_success "Termux MOTD restored"
38
+ }
39
+
40
+ _detect_shell_config() {
41
+ if [[ -f "$HOME/.zshrc" ]]; then
42
+ echo "$HOME/.zshrc"
43
+ elif [[ -f "$HOME/.bashrc" ]]; then
44
+ echo "$HOME/.bashrc"
45
+ fi
46
+ }
47
+
48
+ _install_banner_impl() {
49
+ local shell_config
50
+ shell_config="$(_detect_shell_config)"
51
+
52
+ if [[ -z "$shell_config" ]]; then
53
+ log_warn "No shell config file found (.zshrc or .bashrc)"
54
+ return 1
55
+ fi
56
+
57
+ if grep -qF "$KARNEL_BANNER_MARKER" "$shell_config" 2>/dev/null; then
58
+ log_info "Karnel Banner already installed"
59
+ return 0
60
+ fi
61
+
62
+ local banner_script="$KARNEL_UTILS/banner.sh"
63
+ if [[ ! -f "$banner_script" ]]; then
64
+ log_error "Banner script not found: $banner_script"
65
+ return 1
66
+ fi
67
+
68
+ mkdir -p "$(dirname "$LOG_FILE")"
69
+
70
+ cat >>"$shell_config" <<EOF
71
+
72
+ $KARNEL_BANNER_MARKER
73
+ source "$banner_script"
74
+
75
+ clear() {
76
+ builtin clear 2>/dev/null || /usr/bin/clear 2>/dev/null || clear
77
+ local _banner_cache="\${XDG_CACHE_HOME:-$HOME/.cache}/karnel/banner_cache"
78
+ if [[ -f "$_banner_cache" ]]; then
79
+ cat "$_banner_cache"
80
+ fi
81
+ }
82
+ export -f clear 2>/dev/null
83
+ EOF
84
+
85
+ log_success "Karnel Banner installed"
86
+
87
+ _backup_motd
88
+
89
+ log_warn "Restart Termux or run: source $shell_config"
90
+ return 0
91
+ }
92
+
93
+ install_banner() {
94
+ if grep -qF "$KARNEL_BANNER_MARKER" "$(_detect_shell_config)" 2>/dev/null; then
95
+ log_info "Karnel Banner already installed"
96
+ return 0
97
+ fi
98
+ log_info "Installing Karnel Banner..."
99
+ mkdir -p "$(dirname "$LOG_FILE")"
100
+ loading "Installing Banner" _install_banner_impl
101
+ }
102
+
103
+ _uninstall_banner_impl() {
104
+ local shell_config
105
+ shell_config="$(_detect_shell_config)"
106
+
107
+ if [[ -z "$shell_config" ]]; then
108
+ log_warn "No shell config file found"
109
+ return 1
110
+ fi
111
+
112
+ if ! grep -qF "$KARNEL_BANNER_MARKER" "$shell_config" 2>/dev/null; then
113
+ log_warn "Karnel Banner not installed"
114
+ return 0
115
+ fi
116
+
117
+ local marker_line
118
+ marker_line="$(grep -nF "$KARNEL_BANNER_MARKER" "$shell_config" | head -1 | cut -d: -f1)"
119
+
120
+ if [[ -n "$marker_line" ]]; then
121
+ local prev_line=$((marker_line - 1))
122
+ if sed -n "${prev_line}p" "$shell_config" 2>/dev/null | grep -q '^$'; then
123
+ sed -i "$((prev_line)),$((marker_line + 1))d" "$shell_config"
124
+ else
125
+ sed -i "$marker_line,$((marker_line + 1))d" "$shell_config"
126
+ fi
127
+ log_success "Karnel Banner uninstalled"
128
+ else
129
+ log_warn "Could not locate banner marker for removal"
130
+ return 1
131
+ fi
132
+
133
+ _restore_motd
134
+
135
+ return 0
136
+ }
137
+
138
+ uninstall_banner() {
139
+ if ! grep -qF "$KARNEL_BANNER_MARKER" "$(_detect_shell_config)" 2>/dev/null; then
140
+ log_warn "Karnel Banner not installed"
141
+ return 0
142
+ fi
143
+ log_info "Uninstalling Karnel Banner..."
144
+ loading "Uninstalling Banner" _uninstall_banner_impl
145
+ }
146
+
147
+ _update_banner_impl() {
148
+ uninstall_banner
149
+ install_banner
150
+ }
151
+
152
+ update_banner() {
153
+ log_info "Updating Karnel Banner..."
154
+ loading "Updating Banner" _update_banner_impl
155
+ }
156
+
157
+ reinstall_banner() {
158
+ uninstall_banner
159
+ install_banner
160
+ }
@@ -0,0 +1,42 @@
1
+ # Cursor Color
2
+
3
+ Customize Termux terminal cursor color
4
+
5
+ **Package:** karnel-termux (cursor config)
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Type:** Termux UI customization
9
+ **License:** MIT
10
+
11
+ ## Description
12
+
13
+ Configures the Termux terminal cursor color to a custom value (default: green #00FF00). This provides better cursor visibility and personalization of the Termux terminal appearance.
14
+
15
+ ## Dependencies
16
+
17
+ - Termux (base installation)
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ karnel install ui --cursor
23
+ ```
24
+
25
+ ## Uninstall
26
+
27
+ ```bash
28
+ karnel uninstall ui --cursor
29
+ ```
30
+
31
+ ## Update
32
+
33
+ ```bash
34
+ karnel update ui --cursor
35
+ ```
36
+
37
+ ## Notes
38
+
39
+ - Config file: `~/.termux/colors.properties`
40
+ - Default cursor color: green (#00FF00)
41
+ - Restart Termux to apply changes
42
+
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_ui.log"
6
+ TERMUX_DIR="$HOME/.termux"
7
+
8
+ _install_cursor_impl() {
9
+ mkdir -p "$(dirname "$LOG_FILE")" "$TERMUX_DIR"
10
+
11
+ cat >"$TERMUX_DIR/colors.properties" <<'EOF'
12
+ cursor=#00FF00
13
+ EOF
14
+
15
+ log_success "Cursor color set to #00FF00 (green)"
16
+ return 0
17
+ }
18
+
19
+ install_cursor() {
20
+ if [[ -f "$TERMUX_DIR/colors.properties" ]]; then
21
+ log_info "Cursor Color already configured"
22
+ return 0
23
+ fi
24
+ log_info "Installing Cursor Color..."
25
+ loading "Installing Cursor Color" _install_cursor_impl
26
+ }
27
+
28
+ _uninstall_cursor_impl() {
29
+ if [[ -f "$TERMUX_DIR/colors.properties" ]]; then
30
+ rm "$TERMUX_DIR/colors.properties"
31
+ log_success "Cursor Color uninstalled"
32
+ else
33
+ log_warn "Cursor Color not configured"
34
+ fi
35
+ }
36
+
37
+ uninstall_cursor() {
38
+ if [[ ! -f "$TERMUX_DIR/colors.properties" ]]; then
39
+ log_info "Cursor Color is not installed"
40
+ return 0
41
+ fi
42
+ log_info "Uninstalling Cursor Color..."
43
+ loading "Uninstalling Cursor Color" _uninstall_cursor_impl
44
+ }
45
+
46
+ _update_cursor_impl() {
47
+ install_cursor
48
+ }
49
+
50
+ update_cursor() {
51
+ log_info "Updating Cursor Color..."
52
+ loading "Updating Cursor Color" _update_cursor_impl
53
+ }
54
+
55
+ reinstall_cursor() {
56
+ uninstall_cursor
57
+ install_cursor
58
+ }