diff --git a/README.md b/README.md index 996cfe1..69651ee 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ # poshlostios poshlositi os repository -[stable poshlosti](https://poshlostios.meex.lol) \ -[unstable poshlosti](https://meexreay.github.io/poshlostios) \ No newline at end of file +# Mirrors + +[meex.lol (official)](https://poshlostios.meex.lol) \ +[github pages (unstable)](https://meexreay.github.io/poshlostios) + +# Local run + +You can run PoshlostiOS on your local network with [lighttpd](https://www.lighttpd.net/) + +```bash +git clone https://github.com/MeexReay/poshlostios.git +cd poshlostios +lighttpd -f lighttpd.conf -D +``` + +Then, your server will be available on [127.0.0.1:3000](http://127.0.0.1:3000/index.html) diff --git a/app/neofetch/neofetch.js b/app/neofetch/neofetch.js index f0f8e8a..d0a6e64 100644 --- a/app/neofetch/neofetch.js +++ b/app/neofetch/neofetch.js @@ -25,6 +25,11 @@ function getDurationString(start_time) { return result.join(" "); } +function getDiskInfo() { + let file_system_size = getFileSystemSize() + return Math.round(file_system_size / 1024)+'KB / '+Math.round(MAX_STORAGE / 1024)+'KB ('+Math.round(file_system_size / MAX_STORAGE * 100)+"%) - pfs" +} + // Function to get CPU, GPU, and memory information function getSystemInfo() { const cpuInfo = navigator.hardwareConcurrency; @@ -50,7 +55,7 @@ function getSystemInfo() { cpuInfo + " cores", memoryInfo ? memoryInfo * 1024 + ' MB' : 'Not supported', totalJSHeap.toFixed(2) + ' MB', - gpuInfo ? `${gpuInfo.renderer}` : 'GPU Info not available' + gpuInfo ? `${gpuInfo.renderer}` : 'Poshlosti GGraphics 1.0.233' ] } @@ -68,7 +73,7 @@ async function main(args) { █░░░░░░░░█ Memory: ${now_mem} / ${max_mem} █░░░░░░░░█ CPU: ${cpu} █░░░░░░░░░█ GPU: ${gpu} - ██░░░░░░░░███████ + ██░░░░░░░░███████ Disk (/): ${getDiskInfo()} █░░████████▓▓▓█ █████████▓▓▓▓▓▓▓▓▓██ █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ @@ -79,4 +84,4 @@ async function main(args) { `) return 0 -} \ No newline at end of file +} diff --git a/app/neofetch/package.json b/app/neofetch/package.json index 2caa673..4ec97eb 100644 --- a/app/neofetch/package.json +++ b/app/neofetch/package.json @@ -1,8 +1,8 @@ { "name": "neofetch", - "version": "0.1.1", + "version": "0.1.2", "description": "neofetch damn", "author": "MeexReay", "apps": [ "neofetch.js" ], "configs": [] -} \ No newline at end of file +} diff --git a/app/posh/posh.js b/app/posh/posh.js index 0db057e..beefc6c 100644 --- a/app/posh/posh.js +++ b/app/posh/posh.js @@ -25,6 +25,7 @@ async function processCommand(command, args) { await writeStdout("\nСтатус код: "+code+"\n") } } catch (e) { + console.log(e) await writeStdout("Не запустилася\n") } } else { @@ -87,4 +88,4 @@ async function main(args) { } return 0 -} \ No newline at end of file +} diff --git a/app/ppm/package.json b/app/ppm/package.json index 33b127c..2e1f9f6 100644 --- a/app/ppm/package.json +++ b/app/ppm/package.json @@ -1,8 +1,8 @@ { "name": "ppm", - "version": "0.1.5", + "version": "0.1.6", "description": "Poshliy Package Manager", "author": "MeexReay", "apps": [ "ppm.js" ], "configs": [ "ppm.json" ] -} \ No newline at end of file +} diff --git a/app/ppm/ppm.json b/app/ppm/ppm.json index f267c6d..9e9144e 100644 --- a/app/ppm/ppm.json +++ b/app/ppm/ppm.json @@ -1,7 +1,8 @@ { "repositories": [ + "app", "https://poshlostios.meex.lol/app", "https://meexreay.github.io/poshlostios/app", "https://raw.githubusercontent.com/MeexReay/poshlostios/refs/heads/main/app" ] -} \ No newline at end of file +} diff --git a/lighttpd.conf b/lighttpd.conf new file mode 100644 index 0000000..5970ce3 --- /dev/null +++ b/lighttpd.conf @@ -0,0 +1,2 @@ +server.document-root = var.CWD +server.port = 3000 diff --git a/sys/const.js b/sys/const.js index 5aaa90c..cf2b25a 100644 --- a/sys/const.js +++ b/sys/const.js @@ -1,3 +1,4 @@ +const MAX_STORAGE = 5120 * 1024 // Limit of local storage size, 5120 KB by default const APP_REPOSITORY = "app" // Repository url to download apps from const DEFAULT_APPS = [ "posh", // required @@ -9,4 +10,4 @@ const DEFAULT_APPS = [ "kfc", "woman" ] -const STARTUP_COMMAND = [ "/app/posh.js" ] \ No newline at end of file +const STARTUP_COMMAND = [ "/app/posh.js" ] diff --git a/sys/fs.js b/sys/fs.js index c549aeb..18356f5 100644 --- a/sys/fs.js +++ b/sys/fs.js @@ -220,4 +220,16 @@ function clearFileSystem() { callback(fs_mapping) fs_mapping = {} saveMapping() -} \ No newline at end of file +} + +function getFileSystemSize() { + let total = 0 + for (let x in localStorage) { + if (!localStorage.hasOwnProperty(x)) { + continue; + } + let len = ((localStorage[x].length + x.length) * 2) + total += len + } + return total +}