summaryrefslogtreecommitdiff
path: root/Library/SDK
diff options
context:
space:
mode:
Diffstat (limited to 'Library/SDK')
-rw-r--r--Library/SDK/Entrypoint.js18
-rw-r--r--Library/SDK/Modules/Strawberry.Dialog.js23
-rw-r--r--Library/SDK/Modules/Strawberry.MenuBar.js15
-rw-r--r--Library/SDK/Modules/Strawberry.SystemInfo.js9
-rw-r--r--Library/SDK/test.txt1
5 files changed, 45 insertions, 21 deletions
diff --git a/Library/SDK/Entrypoint.js b/Library/SDK/Entrypoint.js
index d55d823..9d7e4a2 100644
--- a/Library/SDK/Entrypoint.js
+++ b/Library/SDK/Entrypoint.js
@@ -13,10 +13,6 @@ readline.emitKeypressEvents(process.stdin);
Launcher = require("../Launcher");
process.stdin.on('keypress', (str, key) => {
- for (let func of Strawberry.KeyboardEvents) {
- func(key.sequence);
- }
-
if (key.sequence === '\u0003') {
require('show-terminal-cursor')();
process.exit();
@@ -24,6 +20,10 @@ process.stdin.on('keypress', (str, key) => {
if (!Strawberry.ProcessKeyboard) return;
+ for (let func of Strawberry.KeyboardEvents) {
+ func(key.sequence);
+ }
+
if (!global._STRAWBERRY_APPMENU_OPEN) {
try {
Strawberry.MenuBar.Reset();
@@ -362,6 +362,8 @@ global._STRAWBERRY_INIT_APP = () => {
ProcessKeyboard: true,
WhenLoaded: () => {},
StartLoad: (skipCoolLoading) => {
+ global._STRAWBERRY_CURRENT_APP = Strawberry.App;
+
load("Strawberry.Audio");
if (!skipCoolLoading) skipCoolLoading = false;
@@ -433,7 +435,7 @@ global._STRAWBERRY_INIT_APP = () => {
global._STRAWBERRY_INIT_APP();
global.load = (module) => {
- if (require('os').platform() === "linux" && module === "Strawberry.Menubar") {
+ if (module === "Strawberry.Menubar") {
module = "Strawberry.MenuBar";
}
@@ -451,11 +453,7 @@ global.load = (module) => {
Strawberry[parts[1]] = require("./Modules/" + module);
}
- if (module === "Strawberry.Menubar") {
- load("Strawberry.MenuBar");
- }
-
- if (require('os').platform() === "linux" && module === "Strawberry.MenuBar") {
+ if (module === "Strawberry.MenuBar") {
Strawberry.Menubar = Strawberry.MenuBar;
}
} \ No newline at end of file
diff --git a/Library/SDK/Modules/Strawberry.Dialog.js b/Library/SDK/Modules/Strawberry.Dialog.js
index 95b0d9d..c5d2bac 100644
--- a/Library/SDK/Modules/Strawberry.Dialog.js
+++ b/Library/SDK/Modules/Strawberry.Dialog.js
@@ -10,11 +10,11 @@ let self = {
process.stdout.write("\n");
}
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("╭───" + "─".repeat(message.length) + "───╮"));
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("│ " + " ".repeat(message.length) + " │"));
- console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("│") + " " + message + " " + color[col]("│")));
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("│ " + " ".repeat(message.length) + " │"));
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("╰───" + "─".repeat(message.length) + "───╯"));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┏━━━" + "━".repeat(message.length) + "━━━┓"));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(message.length) + " ┃"));
+ console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + message + " " + color[col]("┃")));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(message.length) + " ┃"));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┗━━━" + "─".repeat(message.length) + "━━━┛"));
for (let n = 0; n < (vertical - 3); n++) {
process.stdout.write("\n");
@@ -27,7 +27,7 @@ let self = {
return a.length > b.length ? a : b
}, '');
- global.vertical = Math.round(process.stdout.rows / 2 + 1) - 5;
+ global.vertical = Math.round(process.stdout.rows / 2 + 1) - 5 - (lines.length / 2);
let horizontal = Math.round(process.stdout.columns / 2 - (1 + ((longest.length + 8) / 2)));
for (let n = 0; n < vertical; n++) {
@@ -37,8 +37,15 @@ let self = {
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┏━━━" + "━".repeat(longest.length) + "━━━┓"));
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃"));
+ let index = 0;
for (let line of lines) {
- console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + line + " ".repeat(longest.length - line.length) + " " + color[col]("┃")));
+ if (index === 0) {
+ console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + chalk.underline(line) + " ".repeat(longest.length - line.length) + " " + color[col]("┃")));
+ } else {
+ console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + line + " ".repeat(longest.length - line.length) + " " + color[col]("┃")));
+ }
+
+ index++;
}
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃"));
@@ -46,7 +53,7 @@ let self = {
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃"));
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┗━━━" + "━".repeat(longest.length) + "━━━┛"));
- for (let n = 0; n < (vertical - 3); n++) {
+ for (let n = 0; n < (vertical - 3 - lines.length); n++) {
process.stdout.write("\n");
}
diff --git a/Library/SDK/Modules/Strawberry.MenuBar.js b/Library/SDK/Modules/Strawberry.MenuBar.js
index 957dcf1..35eced6 100644
--- a/Library/SDK/Modules/Strawberry.MenuBar.js
+++ b/Library/SDK/Modules/Strawberry.MenuBar.js
@@ -28,8 +28,13 @@ self = {
},
Reset: () => {
process.stdout.cursorTo(0, 0);
- process.stdout.write(color.reset(color.bgBlue(" " + color.black.bgYellowBright(" O ") + " " + menus + " ".repeat(process.stdout.columns - (15 + Strawberry.App.length + menusText.length)) + new Date().toTimeString().substring(0, 5) + " " + name + " ")))
- process.stdout.cursorTo(0, process.stdout.rows);
+ if (global._STRAWBERRY_DEBUG_MODE) {
+ process.stdout.write(color.reset(color.bgBlue(" " + color.black.bgYellowBright(" O ") + " " + menus + " ".repeat(process.stdout.columns - (15 + Strawberry.App.length + menusText.length + 4)) + new Date().toTimeString().substring(0, 5) + " " + name + " " + color.bgRed.black(" D ") + " ")))
+ process.stdout.cursorTo(0, process.stdout.rows);
+ } else {
+ process.stdout.write(color.reset(color.bgBlue(" " + color.black.bgYellowBright(" O ") + " " + menus + " ".repeat(process.stdout.columns - (15 + Strawberry.App.length + menusText.length)) + new Date().toTimeString().substring(0, 5) + " " + name + " ")))
+ process.stdout.cursorTo(0, process.stdout.rows);
+ }
},
Active: (item) => {
let a = Strawberry.Menus.filter((_, i) => {
@@ -129,7 +134,11 @@ self = {
},
UpdateClock: () => {
- process.stdout.cursorTo(process.stdout.columns - (10 + Strawberry.App.length), 0);
+ if (global._STRAWBERRY_DEBUG_MODE) {
+ process.stdout.cursorTo(process.stdout.columns - (10 + Strawberry.App.length + 4), 0);
+ } else {
+ process.stdout.cursorTo(process.stdout.columns - (10 + Strawberry.App.length), 0);
+ }
process.stdout.write(color.bgBlue(new Date().toTimeString().substring(0, 5)));
process.stdout.cursorTo(0, process.stdout.rows);
}
diff --git a/Library/SDK/Modules/Strawberry.SystemInfo.js b/Library/SDK/Modules/Strawberry.SystemInfo.js
index b52b1c2..cf44c52 100644
--- a/Library/SDK/Modules/Strawberry.SystemInfo.js
+++ b/Library/SDK/Modules/Strawberry.SystemInfo.js
@@ -57,6 +57,9 @@ module.exports = {
if (proc['name'].startsWith(global._STRAWBERRY_SYSTEM_ROOT)) {
proc['name'] = "/System" + proc['name'].substring(global._STRAWBERRY_SYSTEM_ROOT.length);
}
+ if (proc['name'].includes("/node_modules/")) {
+ proc['name'] = chalk.gray(proc['name']);
+ }
if (proc['name'].startsWith("/Strawberry")) {
proc['name'] = proc['name'].substring(11);
}
@@ -107,6 +110,9 @@ module.exports = {
if (child['name'].startsWith("/Strawberry")) {
child['name'] = child['name'].substring(11);
}
+ if (child['name'].includes("/node_modules/")) {
+ child['name'] = chalk.gray(child['name']);
+ }
if (child['name'].startsWith("/System/Library/SDK/")) {
child['name'] = chalk.yellow(child['name']);
}
@@ -157,6 +163,9 @@ module.exports = {
if (child2['name'].startsWith("/Strawberry")) {
child2['name'] = child2['name'].substring(11);
}
+ if (child2['name'].includes("/node_modules/")) {
+ child2['name'] = chalk.gray(child2['name']);
+ }
if (child2['name'].startsWith("/System/Library/SDK/")) {
child2['name'] = chalk.yellow(child2['name']);
}
diff --git a/Library/SDK/test.txt b/Library/SDK/test.txt
new file mode 100644
index 0000000..6fb1bde
--- /dev/null
+++ b/Library/SDK/test.txt
@@ -0,0 +1 @@
+hello \ No newline at end of file