diff options
author | RaindropsSys <contact@minteck.org> | 2023-06-18 10:21:55 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-06-18 10:21:55 +0200 |
commit | 391ed3d1afa0334390df24af3f1ab13cf7066a84 (patch) | |
tree | b1e839a44b3276391bd0dca5c2b9438d17824fa4 | |
parent | b866a05ca2e3be0e6d379e68ec8a0ba6064a5248 (diff) | |
download | kirinos-391ed3d1afa0334390df24af3f1ab13cf7066a84.tar.gz kirinos-391ed3d1afa0334390df24af3f1ab13cf7066a84.tar.bz2 kirinos-391ed3d1afa0334390df24af3f1ab13cf7066a84.zip |
Updated 4 files, added 5 files and deleted core/index.html (automated)
-rw-r--r-- | .idea/jsLibraryMappings.xml | 6 | ||||
-rw-r--r-- | core/index.html | 18 | ||||
-rw-r--r-- | core/startup/index.html | 128 | ||||
-rw-r--r-- | core/startup/loader.svg | 52 | ||||
-rw-r--r-- | main.js | 13 | ||||
-rw-r--r-- | setup.sh | 19 | ||||
-rw-r--r-- | setup/mostartup.service | 23 | ||||
-rw-r--r-- | setup/xinitrc | 1 | ||||
-rw-r--r-- | startup.sh | 19 | ||||
-rw-r--r-- | x11.sh | 19 |
10 files changed, 275 insertions, 23 deletions
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..d23208f --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="JavaScriptLibraryMappings"> + <includedPredefinedLibrary name="Node.js Core" /> + </component> +</project>
\ No newline at end of file diff --git a/core/index.html b/core/index.html deleted file mode 100644 index 4751dc6..0000000 --- a/core/index.html +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>mangoos</title> - <style> - html, body { - background-color: black; - color: white; - } - </style> -</head> -<body> - <h1>Vapor is cute</h1> - <p>UwU<br>(Lyra is too)</p> - <p>Cloudburst saw this eep (I broke everything because of her, so not cute)</p> -</body> -</html>
\ No newline at end of file diff --git a/core/startup/index.html b/core/startup/index.html new file mode 100644 index 0000000..edd1c63 --- /dev/null +++ b/core/startup/index.html @@ -0,0 +1,128 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>mangoos</title> + <style> + * { + font-family: "Inter", sans-serif; + pointer-events: none; + user-select: none; + user-focus: none; + cursor: none; + } + + html, body { + background-color: cornflowerblue; + color: black; + margin: 0; + } + </style> +</head> +<body> + <div style="display: flex; align-items: center; justify-content: center; position: fixed; inset: 0;"> + <div style="background: rgba(255, 255, 255, .75); backdrop-filter: blur(10px); padding: 50px; width: 512px; height: 256px; border-radius: 10px;"> + <div style="height: calc(100% - 48px + 50px); display: flex; align-items: center; justify-content: center;"> + <div> + <img src="../../logo.svg" style="width: 96px; display: block; margin-left: auto; margin-right: auto;"> + <h2 style="text-align: center;">Welcome to mangoOS</h2> + </div> + </div> + <div style="background: rgba(0, 0, 0, .1); height: 48px; margin: 0 -50px -50px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; border-top: 1px solid rgba(0, 0, 0, .1);"> + <div style="display: flex; align-items: center; height: 100%; padding: 0 10px;"> + <img src="loader.svg" style="width: 42px; opacity: .5;"> + <span id="loading-message">Hold down Shift to disable loading system extensions</span> + </div> + </div> + </div> + </div> + + <script> + const steps = [ + { + title: "Loading kernel extensions...", + command: "systemctl start kmod.service" + }, + { + title: "Applying kernel variables...", + command: "systemctl start systemd-sysctl.service" + }, + { + title: "Starting scheduled jobs manager...", + command: "systemctl start cron.service" + }, + { + title: "Starting desktop manager...", + command: "systemctl start dbus.service" + }, + { + title: "Starting OpenSSH server...", + command: "systemctl start ssh.service" + }, + { + title: "Starting NTP client...", + command: "systemctl start systemd-timesyncd.service" + }, + { + title: "Starting device manager...", + command: "systemctl start systemd-udevd.service" + }, + { + title: "Initialising network core...", + command: "systemctl start networking.service" + }, + { + title: "Initialising network frontend...", + command: "systemctl start NetworkManager.service" + }, + { + title: "Initialising WLAN manager...", + command: "systemctl start wpa_supplicant.service" + }, + { + title: "Starting UNIX policy manager...", + command: "systemctl start polkit.service" + } + ]; + + const cp = require('child_process'); + + function sleep(ms) { + return new Promise((res) => { + setTimeout(res, ms); + }); + } + + function exec(cmd) { + return new Promise((res, rej) => { + let p = cp.exec(cmd); + + p.on('close', (code, signal) => { + if (!code || code === 0) { + res(code, signal); + } else { + rej(code, signal); + } + }) + }); + } + + setTimeout(async () => { + for (let step of steps) { + document.getElementById("loading-message").innerText = step.title; + await sleep(100); + + try { + await exec(step.command); + await sleep(100); + } catch (e) { + console.error(e); + } + } + + document.getElementById("loading-message").innerText = "Initialising login screen..."; + location.href = "../login/index.html"; + }, 3000); + </script> +</body> +</html>
\ No newline at end of file diff --git a/core/startup/loader.svg b/core/startup/loader.svg new file mode 100644 index 0000000..8d4e7ee --- /dev/null +++ b/core/startup/loader.svg @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: none; display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"> +<g transform="rotate(0 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(30 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(60 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(90 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(120 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(150 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(180 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(210 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(240 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(270 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(300 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"></animate> + </rect> +</g><g transform="rotate(330 50 50)"> + <rect x="48" y="24" rx="0" ry="0" width="4" height="12" fill="#000000"> + <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate> + </rect> +</g> +<!-- [ldio] generated by https://loading.io/ --></svg>
\ No newline at end of file @@ -6,10 +6,11 @@ const path = require('path') const createWindow = () => { const mainWindow = new BrowserWindow({ - backgroundColor: "#000000", + backgroundColor: "#6495ED", x: 0, y: 0, frame: false, + show: false, width: screen.getPrimaryDisplay().workAreaSize.width, height: screen.getPrimaryDisplay().workAreaSize.height, fullscreen: true, @@ -17,11 +18,17 @@ const createWindow = () => { webPreferences: { nodeIntegration: true, nodeIntegrationInSubFrames: true, - nodeIntegrationInWorker: true + nodeIntegrationInWorker: true, + contextIsolation: false } }); - mainWindow.loadFile('core/index.html'); + mainWindow.loadFile('./core/startup/index.html'); + + mainWindow.on('ready-to-show', () => { + mainWindow.show(); + mainWindow.focus(); + }) } app.whenReady().then(() => { createWindow(); @@ -1,10 +1,25 @@ #!/bin/bash cd /mango -apt install -y network-manager xserver-xorg x11-xserver-utils xinit libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 libasound2 +apt install -y network-manager xserver-xorg x11-xserver-utils xinit libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 libasound2 fonts-inter +apt autoremove -y chmod -R +x * cp ./setup/modm\@.service /etc/systemd/system/modm\@.service +cp ./setup/mostartup.service /etc/systemd/system/mostartup.service cp ./setup/xinitrc /root/.xinitrc cp ./setup/xinitrc /.xinitrc systemctl daemon-reload systemctl disable getty@tty1.service -systemctl enable modm@tty1.service
\ No newline at end of file +systemctl enable modm@tty1.service +systemctl enable mostartup.service +systemctl disable apparmor.service +systemctl disable kmod.service +systemctl disable systemd-sysctl.service +systemctl disable cron.service +systemctl disable dbus.service +systemctl disable ssh.service +systemctl disable systemd-timesyncd.service +systemctl disable systemd-udevd.service +systemctl disable networking.service +systemctl disable NetworkManager.service +systemctl disable wpa_supplicant.service +systemctl disable polkit.service
\ No newline at end of file diff --git a/setup/mostartup.service b/setup/mostartup.service new file mode 100644 index 0000000..a04bbe6 --- /dev/null +++ b/setup/mostartup.service @@ -0,0 +1,23 @@ +[Unit] +Description=mangoOS Startup UI +Before=basic.target +After=local-fs.target +DefaultDependencies=no +Conflicts=rescue.service +Before=rescue.service +ConditionPathExists=/dev/tty0 +IgnoreOnIsolate=yes + +[Service] +Type=oneshot +ExecStart=-/mango/startup.sh +UtmpIdentifier=0 +StandardInput=tty +StandardOutput=tty +TTYPath=/dev/tty0 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes + +[Install] +WantedBy=basic.target
\ No newline at end of file diff --git a/setup/xinitrc b/setup/xinitrc index d7c3029..c73bda4 100644 --- a/setup/xinitrc +++ b/setup/xinitrc @@ -1,3 +1,4 @@ #!/bin/bash cd /mango +xsetroot -solid "#6495ED" -bg "#6495ED" ./init.sh
\ No newline at end of file diff --git a/startup.sh b/startup.sh new file mode 100644 index 0000000..4768a3f --- /dev/null +++ b/startup.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo -en "\e]P06495ED" # black +echo -en "\e]P86495ED" # darkgrey +echo -en "\e]P16495ED" # darkred +echo -en "\e]P96495ED" # red +echo -en "\e]P26495ED" # darkgreen +echo -en "\e]PA6495ED" # green +echo -en "\e]P36495ED" # brown +echo -en "\e]PB6495ED" # yellow +echo -en "\e]P46495ED" # darkblue +echo -en "\e]PC6495ED" # blue +echo -en "\e]P56495ED" # darkmagenta +echo -en "\e]PD6495ED" # magenta +echo -en "\e]P66495ED" # darkcyan +echo -en "\e]PE6495ED" # cyan +echo -en "\e]P76495ED" # lightgrey +echo -en "\e]PF6495ED" # white +clear
\ No newline at end of file @@ -1,2 +1,21 @@ #!/bin/bash + +echo -en "\e]P06495ED" # black +echo -en "\e]P86495ED" # darkgrey +echo -en "\e]P16495ED" # darkred +echo -en "\e]P96495ED" # red +echo -en "\e]P26495ED" # darkgreen +echo -en "\e]PA6495ED" # green +echo -en "\e]P36495ED" # brown +echo -en "\e]PB6495ED" # yellow +echo -en "\e]P46495ED" # darkblue +echo -en "\e]PC6495ED" # blue +echo -en "\e]P56495ED" # darkmagenta +echo -en "\e]PD6495ED" # magenta +echo -en "\e]P66495ED" # darkcyan +echo -en "\e]PE6495ED" # cyan +echo -en "\e]P76495ED" # lightgrey +echo -en "\e]PF6495ED" # white +clear + startx >/dev/null 2>&1
\ No newline at end of file |