Skip to content

PARTLYDECENT/Tentacle-OS-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tentacle-OS-

Linux based lightweight one of a kind operating system design being developed,

TentacleOS Project Overview

TentacleOS is a custom desktop environment built with Electron and JavaScript, designed to mimic a lightweight, themeable operating system. It features windows, a taskbar, start menu, desktop icons, a splash screen, background cycling, notifications, and unique features like the eWaste trash buffer.

Main HTML Files and Their Roles

  • index2.html: The main TentacleOS desktop environment. This is the primary hub where all desktop features, windows, taskbar, start menu, and icons are managed. Most user interaction happens here.
  • index.html: The "Obscyra" desktop. This can be used as a secondary desktop or workspace, accessible from the main menu or via keyboard shortcuts.
  • index1.html: The "Access Panel". This is another alternate workspace, often used for mini games or special apps, also accessible from the main menu or via keyboard shortcuts.
  • splash.html: The splash screen video that plays before loading any of the main environments.

Key Systems and Files

  • main1.js: The core front-end logic for TentacleOS. Handles window management, app launching, desktop icons, start menu, and more.
  • settings.js: Adds customizations, new apps, and extends window behavior (e.g., window animations, theme settings).
  • style1.css: The main stylesheet for the OS look and feel. Controls all theming, layout, and visual polish.
  • preload.js: Securely exposes APIs from the Electron main process to the renderer (for file access, dialogs, etc).
  • main.js: The Electron main process. Handles window creation, splash logic, and global shortcuts.

Lightning-Fast Icon Manipulation (Rapid File Actions)

  • Intuitive Copy & Delete: Right-click any desktop icon for instant copy or delete. Copying creates a new icon instantly; delete moves it to the eWaste bin. This is designed for speed and experimentation—no confirmation dialogs, no friction.
  • eWaste Bin: Drag icons here for soft delete, or right-click the bin to view and restore deleted items. This buffer zone makes file management playful and reversible.
  • Rapid Prototyping: The desktop is a live playground. You can duplicate, delete, and rearrange icons in seconds, making it ideal for rapid UI/UX prototyping, testing, and creative workflows.
  • Breaks Traditional Bottlenecks: No modal dialogs, no slow file trees, no multi-step confirmations. All actions are direct, visual, and undo-friendly. This enables a new style of desktop interaction—fast, fun, and highly productive.

How to Add or Manipulate Features

  • Add a new app: Register it in settings.js or main1.js using appManager.registerApp({...}). Provide an id, name, icon, and a launch function. Set desktopIcon: true to show it on the desktop.
  • Change desktop icons: Edit the ICONS object in main1.js or override in settings.js.
  • Add a mini game or HTML app: Use appManager.registerApp with launch: () => this.launchIframeApp('App Name', 'path/to/app.html').
  • Change the splash video: Replace splash.mp4 in the root directory.
  • Change or add background images: Place bg1.jpg, bg2.jpg, ... up to bg10.jpg in the root. The desktop will cycle through them automatically.
  • Modify the main menu: Edit the menu in index2.html to add or change navigation buttons.
  • Add notifications: Use window.showNotification('Message') from anywhere in the renderer.
  • Customize the eWaste trash zone: The eWaste zone is in index2.html and styled uniquely. Dragging icons into it moves them to the zone instead of deleting.
  • Keyboard shortcuts: Defined in main.js for switching between main pages (1 = Obscyra, 2 = Access Panel, 3 = TentacleOS hub).

Custom Features

  • eWaste Trash Buffer: Unique to TentacleOS, this is a glowing zone where you can drag desktop icons for "soft delete" (they are dimmed and marked as eWaste, not permanently deleted).
  • Exotic Context Menus: Right-click desktop icons for a custom-styled menu with options like delete and copy.
  • Live Clock & Notifications: Taskbar clock and notification system are built-in.
  • Drag-and-Drop Desktop Icons: Icons can be freely moved and arranged.
  • Splash Screen: Plays a video before loading the main OS.
  • Background Cycling: Desktop background cycles through up to 10 images.

Customization & Extension

  • To add new features, extend main1.js (for core logic), settings.js (for custom apps and tweaks), and style1.css (for theming).
  • For new apps, register them with appManager and provide a launch function.
  • For new backgrounds, just add images to the root as bgX.jpg.
  • For new menu items, edit the menu HTML in index2.html.

Page Order b

  • index2.html: Main TentacleOS hub (default desktop)
  • index.html: Obscyra (secondary desktop)
  • index1.html: Access Panel (mini games, special apps)

For any new feature, follow the pattern in main1.js and settings.js—register your app, provide an icon and launch logic, and it will appear in the desktop and start menu automatically. For UI tweaks, use style1.css and the HTML files.

desired processes

Developer Workflow Hacks 5. Process Inheritance Trees - See exactly what spawned what process. Kill a parent and choose whether to kill children or promote them. 6. RAM Playground - Allocate chunks of RAM as temporary file systems. Perfect for build artifacts, temp files, or just fucking around without touching disk. 7. Network Process Monitoring - See exactly which process is making which network requests in real-time. Built into the OS, not some external tool. 8. Auto-Environment Detection - OS detects when you're in a project folder and automatically loads the right Node version, Python env, etc. No more manual switching. UI That Doesn't Suck 9. Tiling Window Magnetism - Windows snap to invisible grids automatically. Drag near another window and they intelligently resize to share space. 10. Context-Aware Clipboard - Clipboard remembers what type of content you copied and where. Paste code in terminal vs text editor and it formats appropriately. 11. Gesture-Based Everything - Mouse gestures for common tasks. Draw a circle to close window, line to split screen, etc. Way faster than clicking menus. 12. Multi-Monitor Workspaces - Each monitor can have its own virtual desktops. Coding on main screen, docs on second, terminal on third. Performance Porn 13. Predictive File Caching - OS learns your patterns and pre-loads files you're likely to open next into RAM. 14. Build Process Optimization - OS watches your build processes and automatically parallelizes tasks, caches unchanged files, etc. 15. Hot-Reload Everything - Change CSS, JS, config files and see changes instantly without restarting anything. 16. Memory Compression - Automatically compress RAM contents of idle processes instead of swapping to disk.

Advanced System Control via Electron and Node.js Electron apps can harness Node.js APIs and native extensions to gain deep system access. Beyond standard GUI functionality, advanced techniques can expose files, processes, network, and hardware interfaces. This report explores methods and modules enabling full system control in Electron, often pushing beyond typical app boundaries.

  1. File System and Disk Manipulation Electron’s main process (and nodeIntegration enabled renderers) can use Node’s fs module for POSIX-like file I/O nodejs.org . For example: js Copy Edit const fs = require('fs/promises'); await fs.writeFile('/path/to/file.txt', 'data'); await fs.mkdir('/path/to/newdir', { recursive: true }); Beyond basic I/O, NPM packages provide richer disk control. For instance, the drivelist module lists all connected drives on Windows, Linux or macOS npmjs.com : js Copy Edit const drivelist = require('drivelist'); const drives = await drivelist.list(); // drives is an array of objects with device, mountpoints, size, etc.:contentReference[oaicite:2]{index=2}. This can be used to detect removable media or unmounted partitions. Low-level disk tasks (formatting, partitioning) typically require platform tools. Electron can spawn shell commands (e.g. diskutil on macOS or diskpart on Windows) via child_process, capturing output or directing stdin for interactive control. File locks or extended attributes may use modules like fs-ext for fcntl locks. Tables or Lists: Advanced file tasks often combine Node and native tools: Disk Imaging / Raw Access: Use fs.open() on raw device paths (e.g. \\.\PhysicalDrive0 on Windows) with elevated privileges, or spawn OS utilities like dd or ddrescue. Modules like node-raw-device (if available) can read block devices. Mount/Unmount Drives: On Linux, invoke mount/umount; on Windows use wmic or PowerShell (via child_process.exec). File Watching: Use fs.watch or libraries like [chokidar] for real-time file system monitoring. Cited Example: Node’s fs module mirrors POSIX file operations nodejs.org , while packages like drivelist enumerate volumes npmjs.com .
  2. Process Management and System Commands Electron (Node) can launch and control other processes. The Node child_process module provides spawn, exec, execFile and fork methods nodejs.org . For example, one might run an OS command and handle its output: js Copy Edit const { spawn } = require('child_process'); const proc = spawn('ping', ['-c', '4', 'example.com']); proc.stdout.on('data', data => console.log(stdout: ${data})); proc.on('close', code => console.log(Exited with ${code})); For Node scripts, child_process.fork(modulePath) spawns a new Node process with an IPC channel for two-way messages nodejs.org . This enables building tools with multiple worker processes or command-line sub-processes. The process global also provides methods like process.kill(pid, signal) to send signals (e.g. SIGINT) nodejs.org . Node can query running processes via native commands (ps, tasklist) or helper modules (e.g. ps-node). Example Hooks: Pseudo-Terminals: Modules like node-pty allow spawning shell sessions with full TTY emulation, useful for terminal-like functionality. Auto-launch on Startup: Using app.setLoginItemSettings({ openAtLogin: true }) on Windows/macOS (and corresponding registry or LaunchAgent tweaks) ensures the Electron app or helper starts at login electronjs.org . Packages like auto-launch automate adding startup entries on multiple OSes. Service Control: On Windows, PowerShell scripts or node-windows can install/uninstall Windows Services. On Linux, one might interact with systemctl or D-Bus (node-dbus) to manage daemons. Cited Fact: Electron apps can spawn subprocesses via Node (e.g. child_process.spawn/exec/fork) to run shell commands or Node modules nodejs.org .
  3. Network Stack Control & Custom Protocols Node’s networking libraries allow deep manipulation: TCP/IPC Sockets: The net module creates TCP or IPC (Unix socket/Windows pipe) servers and clients nodejs.org . For example, net.createServer() can listen on a port or named pipe. Electron’s net module (in the main process) wraps Chromium’s HTTP stack for HTTP/HTTPS requests electronjs.org , handling proxies and advanced auth automatically. UDP and Raw Sockets: For raw packet access, modules like raw-socket expose IPv4/IPv6 raw sockets (via OS-level socket(SOCK_RAW)) npmjs.com . Raw sockets typically require elevated privileges (many OS restrict them to admins) npmjs.com . Using raw sockets or libraries like libpcap bindings (e.g. node_pcap) enables custom packet capture/injection, supporting custom protocols or network scanning. Custom Protocols: Electron’s protocol API can register custom schemes (e.g. myapp://) and intercept requests. Additionally, MessageChannelMain/MessagePortMain provide advanced channel communication between windows or threads. For multi-process IPC: Electron’s ipcMain and ipcRenderer modules handle messages between main and renderer electronjs.org electronjs.org . Node’s child_process.fork (above) similarly provides an IPC channel for parent–child messaging. Peer-to-Peer & Sockets: Libraries such as ws (WebSockets) or dgram (UDP) support custom real-time channels. One could even implement raw ICMP (“ping”) by constructing buffers or using a library like net-ping. Network Monitoring: Tools like ping or pcap2 can probe the network. On Linux/macOS, child_process.exec can run iptables/pfctl to dynamically adjust firewall rules. Cited Detail: Electron’s net module issues HTTP requests via Chromium’s network stack electronjs.org , while Node’s net module provides low-level TCP/IPC sockets nodejs.org . Raw-socket NPM packages enable raw IP packets (subject to OS privileges) npmjs.com .
  4. Hardware Interfacing (Camera, Mic, USB, Serial, Bluetooth) Electron can access many hardware devices using web APIs and Node modules: Camera/Microphone: In renderer processes, standard Web APIs (navigator.mediaDevices.getUserMedia) grant camera/mic streams. Electron’s desktopCapturer lets main or renderer capture screens/audio using getDisplayMedia electronjs.org . For more low-level control (e.g. custom codecs), Node modules like node-webcam or interfacing with FFmpeg via child_process can capture or process media. USB and Serial (Web Serial/USB): Electron supports the Web Serial and WebUSB APIs, but with additional event hooks. The Device Access tutorial shows how to handle the select-serial-port and select-usb-device events on the session to grant permission electronjs.org electronjs.org . These enable using navigator.serial.requestPort or navigator.usb.requestDevice from renderer code. Node modules like serialport or usb also allow raw access to serial ports and USB devices from the main process. Bluetooth: The Web Bluetooth API works in Electron (with permission handling via webContents events) electronjs.org . You can auto-select or prompt for Bluetooth devices. For native Bluetooth beyond Web APIs, modules like noble (BLE) enable scanning and controlling Bluetooth devices using Node. Other Peripherals: Printers and scanners can be accessed via OS commands (e.g. lp/lpr on Unix). IoT hardware (cameras, sensors) with USB or network interfaces can be driven by specific Node libraries or by wrapping their SDKs via ffi-napi. For example, camera SDKs or audio APIs can be called via native addons. Cited APIs: Electron provides Web Serial and WebUSB support by exposing select-serial-port and select-usb-device events on the session electronjs.org electronjs.org . Web Bluetooth is also supported (e.g. handling select-bluetooth-device) electronjs.org . Desktop media (screen/audio) is captured via desktopCapturer.getSources() electronjs.org .
  5. System Integration (Clipboard, Shell, Notifications, OS Services) Electron exposes many OS-level integration points: Clipboard: The clipboard module (main/renderer) reads and writes system clipboard (text, images, etc.) electronjs.org . This allows copying data between the app and other programs. Shell and External Programs: The shell module can open files/folders/URLs with default OS apps, show items in Finder/Explorer, or execute commands like open/xdg-open electronjs.org . For example, shell.openExternal('http://example.com') launches the default browser. Notifications: Electron’s Notification class creates native desktop notifications electronjs.org (on supported OSes). For macOS specifically, systemPreferences.postNotification() can post low-level notifications or subscribe to system-wide ones electronjs.org electronjs.org . System Tray/Dock: The Tray API lets the app sit in the system tray/menu bar with context menus. On Windows, app.setAppUserModelId enables taskbar grouping. Jump lists (Windows) can be customized via app.setJumpList() electronjs.org . Power and OS Events: powerMonitor lets an app respond to sleep, wake, suspend, resume events (battery, lid close, etc.). powerSaveBlocker can inhibit screen sleep. safeStorage offers encryption APIs for secure data storage. autoUpdater hooks into OS-specific update mechanisms (Squirrel on Windows/macOS, etc.). Accessibility and Integrations: The app can integrate with accessibility services (screen readers). The Electron app.setAccessibilitySupportEnabled(true) can toggle Chromium’s accessibility tree electronjs.org . Launcher/Startup: Besides login item settings (see above), tasks like creating desktop shortcuts or file associations use app.setUserTasks or platform installers. Example: Electron’s shell module “manages files and URLs using their default applications” electronjs.org , and the clipboard module can perform copy/paste to the OS clipboard electronjs.org .
  6. System-Level Hooks and Automation To automate or hook system-level events: Global Shortcuts: Using globalShortcut.register(accelerator, callback), an app can listen for key combinations even when it’s not focused electronjs.org . For example, globalShortcut.register('CommandOrControl+X', () => { … }) runs code on that keypress electronjs.org . Note: Some media keys may require enabling accessibility on macOS. Input Simulation: Libraries like RobotJS or nut.js allow programmatically moving the mouse, clicking, and sending keyboard events. (RobotJS, for instance, is a native Node addon that automates desktop input.) On Linux, one can use the uinput kernel module via a native addon to inject events. On macOS/Windows, scripting APIs (AppleScript, Win32 SendInput) can be invoked via native modules or child processes (e.g. running osascript, PowerShell’s SendKeys). Window Management: The Electron main process can control its own BrowserWindow (position, size, z-order). To manage other applications’ windows, one must use OS-specific APIs. For example, on Windows a Node native addon (via ffi or C++ addon) could call User32.dll functions (FindWindow, SetWindowPos). On Linux, X11 libraries or tools like wmctrl can be invoked. Automation & Macros: For end-user automation, the app could expose a macro engine: hooking into mouse/keyboard events, recording/replaying sequences (using RobotJS or by monitoring events in a global hook via a native addon). The [globalShortcut] is one hook; for finer-grained hooks, native modules or OS APIs (like Windows’ Raw Input or Linux’s evdev) are needed. WebContents and DevTools: Electron allows programmatic control of BrowserWindows. For example, webContents.sendInputEvent() simulates key/mouse events in a window. The remote or @electron/remote module (deprecated) could let a renderer call main functions to manipulate windows. Cited API: Electron’s globalShortcut can register system-wide keys electronjs.org . Main/renderer IPC (via ipcMain/ipcRenderer) and the Menu API can hook OS menus or tray clicks to drive app behavior. electronjs.org . (For security reasons, full OS keyboard hooks beyond globalShortcut require native code.)
  7. Plugin Architecture for Extensions Electron apps can load code at runtime to extend functionality. A common pattern is to define a plugin interface (e.g. each plugin exports initialization functions) and dynamically require() plugin modules or scripts. For example, a JSON manifest might list available plugins; upon app startup, the code reads that list and loads each plugin file with require, calling known functions (init(), getUI(), etc.). One implementation suggests each plugin JS file exports an html() function (providing its UI) and Events() to attach logic stackoverflow.com . A project might use separate “plugin repositories” for the main and renderer processes to isolate contexts beyondco.de . Electron’s file system APIs allow scanning plugin directories (e.g. ${app.getPath('userData')}/plugins/) and loading them. A plugin’s package.json could specify its entry points (like "main" and "renderer" scripts) as seen in VSCode extensions beyondco.de . The app then communicates with plugins via predefined IPC channels or a shared API layer. This dynamic loading can also be done with native addons: the app could load .node modules at runtime if built for the correct Electron version. Cited Example: Plugins typically consist of a manifest (e.g. package.json with "main" and "renderer" entries) and JS entry files. An Electron app can detect plugin folders (e.g. under userData/plugins) and load them by require() beyondco.de beyondco.de .
  8. Security and Sandboxing Considerations Since Electron apps have OS access, security is crucial. Key guidelines include: Context Isolation & Node Integration: By default, Electron allows Node in renderers. For untrusted content (e.g. any remote-loaded page), disable Node integration and enable contextIsolation electronjs.org . The security docs warn: “Under no circumstances should you load and execute remote code with Node.js integration enabled” electronjs.org . Use the contextBridge/ipcRenderer APIs to expose only safe methods to the page. Sandbox Mode: Electron can run renderers in a stricter Chrome sandbox (sandbox: true in BrowserWindow). Combined with nodeIntegration: false, this limits renderer to Chromium’s sandbox. The ses.setPermissionRequestHandler() can further control access (e.g. deny geolocation, media, etc). Least Privilege: Use app.requestSingleInstanceLock(), avoid running as root/admin unless necessary, and update Electron/Chromium promptly to patch vulnerabilities electronjs.org electronjs.org . Don’t disable features like webSecurity or override Content-Security-Policy; restrict mixed content. Only load files via file:// that are bundled with the app. Trusted Code: Audit all third-party Node modules. Electron’s high privileges mean an npm vulnerability is especially dangerous. Tools like Electronegativity can scan for common misconfigurations. The security docs emphasize: “Displaying arbitrary content from untrusted sources poses a severe security risk” electronjs.org electronjs.org . Cited Warning: Electron developers must “follow important best practices”: disable Node in renderer, enable contextIsolation, keep Electron up-to-date, and only execute local code electronjs.org electronjs.org .
  9. Novel “Control Arms” (New I/O and Interaction Patterns) Beyond standard devices, creative extensions can act as new input/output “arms” for control: Voice and Gesture: Incorporate voice commands using Web Speech API or a native library (e.g. node-record-lpcm16 + Google Speech), turning speech into system actions. Use camera input with ML (e.g. OpenCV or TensorFlow.js) for gesture controls. Virtual Devices: Use virtual controllers (e.g. node-vigemclient on Windows) to create gamepad/joystick devices, letting phones or custom hardware control the PC. For example, one could send XInput commands to drive a virtual Xbox controller via Bluetooth. Brain-Computer Interfaces: Though cutting-edge, libraries exist for EEG headsets (e.g. node-emotiv). Processing brainwave signals could map to UI actions. Haptic and Feedback Devices: If the app controls external hardware (via USB/serial), it could send commands to motors, LEDs, or haptic devices to create new output channels. Dynamic Kernel Messaging: Advanced apps might interface with kernel services. For instance, on Linux use netlink sockets or ioctl with native modules to capture low-level events, or on Windows use WMI event subscriptions (e.g. via node-wmi) to react to hardware changes. While rare, one could even write a custom kernel driver and communicate with it from Electron (e.g. for specialized instrumentation). This area is largely open-ended. Key idea: use any available channel (USB, network, audio, video, haptics) as a control surface, and process it in Electron via Node APIs or native addons.
  10. OS-Specific APIs and Capabilities Windows: Electron can call Win32/COM APIs via native addons or libraries. Use ffi-napi or C++ addons to access WMI, registry or UIAutomation. For example, manipulate registry for settings or registry-run keys for autorun. The Windows Speech API (SAPI) or UIA (Accessibility API) can be accessed by COM wrappers. Tools like PowerShell or [windows-store-app-analogs] may be launched via child_process. macOS: System Preferences and services (spotlight, launchd). Electron’s systemPreferences API taps into macOS settings (dark mode, accent color) electronjs.org . The NSUserNotification or Notification Center can be used via systemPreferences.postNotification() electronjs.org . Scripting with AppleScript (osascript via exec) or Objective-C frameworks via native module (Cocoa GUI, CoreAudio) unlock features like controlling iTunes, iCloud, or TouchBar/TouchID. Linux: D-Bus interfaces (via dbus-native) allow interacting with many services (NetworkManager, systemd, notifications). Interact with xdg-open, xrandr, pulseaudio, etc., via shell. Linux-only modules like node-udev (if maintained) can monitor hardware plug/unplug. For input/output, /dev/input devices or uinput can be used by native code. Cross-Platform: Electron’s autoUpdater (Squirrel/MAS) and others abstract some differences. Use process.platform to branch logic. Cited Example: On macOS, systemPreferences.postNotification(event, userInfo) can emit native notifications via NSDistributedNotificationCenter electronjs.org . Similarly, Windows login items are set with app.setLoginItemSettings({openAtLogin:true}) electronjs.org . References: Electron and Node.js documentation and community resources were used extensively. For example, the Node.js fs API docs nodejs.org , child_process docs nodejs.org , and Electron’s official documentation on device access electronjs.org electronjs.org , global shortcuts electronjs.org , and security practices electronjs.org . Additional capabilities are illustrated via NPM module examples (e.g. drivelist npmjs.com , raw-socket npmjs.com ) and community solutions stackoverflow.com beyondco.de . All cited sources provide further technical details on the APIs and techniques discussed.

About

Linux based lightweight one of a kind operating system design being developed,

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published