commit b5f32916b1d8761e8d5a651e1be8b05f25b5993d2e3d500cac2900368cdedc0c
Author: Cybrkyd <git@cybrkyd.com>
Date: Sat Jun 13 11:13:28 2026 +0100
Initialise
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4d7c5c3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+ # Neutralinojs binaries and builds
+ /bin
+ /dist
+
+ # Neutralinojs client (minified)
+ neutralino.js
+
+ # Neutralinojs related files
+ .storage
+ *.log
diff --git a/neutralino.config.json b/neutralino.config.json
new file mode 100644
index 0000000..c588d7a
--- /dev/null
+++ b/neutralino.config.json
@@ -0,0 +1,83 @@
+ {
+ "$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json",
+ "applicationId": "js.neutralino.sample",
+ "version": "1.0.0",
+ "defaultMode": "window",
+ "port": 0,
+ "documentRoot": "/resources/",
+ "url": "/",
+ "enableServer": true,
+ "enableNativeAPI": true,
+ "tokenSecurity": "one-time",
+ "logging": {
+ "enabled": true,
+ "writeToLogFile": true
+ },
+ "nativeAllowList": [
+ "app.*",
+ "os.*",
+ "debug.log"
+ ],
+ "globalVariables": {
+ "TEST1": "Hello",
+ "TEST2": [
+ 2,
+ 4,
+ 5
+ ],
+ "TEST3": {
+ "value1": 10,
+ "value2": {}
+ }
+ },
+ "modes": {
+ "window": {
+ "title": "jottings",
+ "width": 800,
+ "height": 500,
+ "minWidth": 400,
+ "minHeight": 200,
+ "center": true,
+ "fullScreen": false,
+ "alwaysOnTop": false,
+ "icon": "/resources/icons/appIcon.png",
+ "enableInspector": true,
+ "borderless": false,
+ "maximize": false,
+ "hidden": false,
+ "resizable": true,
+ "exitProcessOnClose": false
+ },
+ "browser": {
+ "globalVariables": {
+ "TEST": "Test value browser"
+ },
+ "nativeBlockList": [
+ "filesystem.*"
+ ]
+ },
+ "cloud": {
+ "url": "/resources/#cloud",
+ "nativeAllowList": [
+ "app.*"
+ ]
+ },
+ "chrome": {
+ "width": 800,
+ "height": 500,
+ "args": "--user-agent=\"Neutralinojs chrome mode\"",
+ "nativeBlockList": [
+ "filesystem.*",
+ "os.*"
+ ]
+ }
+ },
+ "cli": {
+ "binaryName": "jottings",
+ "resourcesPath": "/resources/",
+ "extensionsPath": "/extensions/",
+ "clientLibrary": "/resources/js/neutralino.js",
+ "binaryVersion": "6.8.0",
+ "clientVersion": "6.8.0"
+ }
+ }
\ No newline at end of file
diff --git a/resources/icons/appIcon.png b/resources/icons/appIcon.png
new file mode 100644
index 0000000..607ba6c
Binary files /dev/null and b/resources/icons/appIcon.png differ
diff --git a/resources/icons/logo.gif b/resources/icons/logo.gif
new file mode 100644
index 0000000..497a66f
Binary files /dev/null and b/resources/icons/logo.gif differ
diff --git a/resources/icons/trayIcon.png b/resources/icons/trayIcon.png
new file mode 100644
index 0000000..a56b000
Binary files /dev/null and b/resources/icons/trayIcon.png differ
diff --git a/resources/index.html b/resources/index.html
new file mode 100644
index 0000000..5879b3e
--- /dev/null
+++ b/resources/index.html
@@ -0,0 +1,27 @@
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Neutralinojs sample app</title>
+ <link rel="stylesheet" href="/styles.css">
+ </head>
+ <body>
+ <div id="neutralinoapp">
+ <h1>Neutralinojs</h1>
+ <div id="info"></div>
+ <br/>
+ <img src="/icons/logo.gif" alt="Neutralinojs" />
+ <div>
+ <a href="#" onclick="openDocs();">Docs</a> ·
+ <a href="#" onclick="openTutorial();">Video tutorial</a>
+ </div>
+ </div>
+ <!-- Neutralino.js client. This file is gitignored,
+ because `neu update` typically downloads it.
+ Avoid copy-pasting it.
+ -->
+ <script src="/js/neutralino.js"></script>
+ <!-- Your app's source files -->
+ <script src="/js/main.js"></script>
+ </body>
+ </html>
diff --git a/resources/js/main.js b/resources/js/main.js
new file mode 100644
index 0000000..a9049f4
--- /dev/null
+++ b/resources/js/main.js
@@ -0,0 +1,99 @@
+ // This is just a sample app. You can structure your Neutralinojs app code as you wish.
+ // This example app is written with vanilla JavaScript and HTML.
+ // Feel free to use any frontend framework you like :)
+ // See more details: https://neutralino.js.org/docs/how-to/use-a-frontend-library
+
+ /*
+ Function to display information about the Neutralino app.
+ This function updates the content of the 'info' element in the HTML
+ with details regarding the running Neutralino application, including
+ its ID, port, operating system, and version information.
+ */
+ function showInfo() {
+ document.getElementById('info').innerHTML = `
+ ${NL_APPID} is running on port ${NL_PORT} inside ${NL_OS}
+ <br/><br/>
+ <span>server: v${NL_VERSION} . client: v${NL_CVERSION}</span>
+ `;
+ }
+
+ /*
+ Function to open the official Neutralino documentation in the default web browser.
+ */
+ function openDocs() {
+ Neutralino.os.open("https://neutralino.js.org/docs");
+ }
+
+ /*
+ Function to open a tutorial video on Neutralino's official YouTube channel in the default web browser.
+ */
+ function openTutorial() {
+ Neutralino.os.open("https://www.youtube.com/c/CodeZri");
+ }
+
+ /*
+ Function to set up a system tray menu with options specific to the window mode.
+ This function checks if the application is running in window mode, and if so,
+ it defines the tray menu items and sets up the tray accordingly.
+ */
+ function setTray() {
+ // Tray menu is only available in window mode
+ if(NL_MODE != "window") {
+ console.log("INFO: Tray menu is only available in the window mode.");
+ return;
+ }
+
+ // Define tray menu items
+ let tray = {
+ icon: "/resources/icons/trayIcon.png",
+ menuItems: [
+ {id: "VERSION", text: "Get version"},
+ {id: "SEP", text: "-"},
+ {id: "QUIT", text: "Quit"}
+ ]
+ };
+
+ // Set the tray menu
+ Neutralino.os.setTray(tray);
+ }
+
+ /*
+ Function to handle click events on the tray menu items.
+ This function performs different actions based on the clicked item's ID,
+ such as displaying version information or exiting the application.
+ */
+ function onTrayMenuItemClicked(event) {
+ switch(event.detail.id) {
+ case "VERSION":
+ // Display version information
+ Neutralino.os.showMessageBox("Version information",
+ `Neutralinojs server: v${NL_VERSION} | Neutralinojs client: v${NL_CVERSION}`);
+ break;
+ case "QUIT":
+ // Exit the application
+ Neutralino.app.exit();
+ break;
+ }
+ }
+
+ /*
+ Function to handle the window close event by gracefully exiting the Neutralino application.
+ */
+ function onWindowClose() {
+ Neutralino.app.exit();
+ }
+
+ // Initialize Neutralino
+ Neutralino.init();
+
+ // Register event listeners
+ Neutralino.events.on("trayMenuItemClicked", onTrayMenuItemClicked);
+ Neutralino.events.on("windowClose", onWindowClose);
+
+ // Conditional initialization: Set up system tray if not running on macOS
+ if(NL_OS != "Darwin") { // TODO: Fix https://github.com/neutralinojs/neutralinojs/issues/615
+ setTray();
+ }
+
+ // Display app information
+ showInfo();
diff --git a/resources/js/neutralino.d.ts b/resources/js/neutralino.d.ts
new file mode 100644
index 0000000..fe7c2e8
--- /dev/null
+++ b/resources/js/neutralino.d.ts
@@ -0,0 +1,565 @@
+ export declare enum LoggerType {
+ WARNING = "WARNING",
+ ERROR = "ERROR",
+ INFO = "INFO"
+ }
+ export declare enum Icon {
+ WARNING = "WARNING",
+ ERROR = "ERROR",
+ INFO = "INFO",
+ QUESTION = "QUESTION"
+ }
+ export declare enum MessageBoxChoice {
+ OK = "OK",
+ OK_CANCEL = "OK_CANCEL",
+ YES_NO = "YES_NO",
+ YES_NO_CANCEL = "YES_NO_CANCEL",
+ RETRY_CANCEL = "RETRY_CANCEL",
+ ABORT_RETRY_IGNORE = "ABORT_RETRY_IGNORE"
+ }
+ export declare enum ClipboardFormat {
+ unknown = "unknown",
+ text = "text",
+ image = "image"
+ }
+ export declare enum Mode {
+ window = "window",
+ browser = "browser",
+ cloud = "cloud",
+ chrome = "chrome"
+ }
+ export declare enum OperatingSystem {
+ Linux = "Linux",
+ Windows = "Windows",
+ Darwin = "Darwin",
+ FreeBSD = "FreeBSD",
+ Unknown = "Unknown"
+ }
+ export declare enum Architecture {
+ x64 = "x64",
+ arm = "arm",
+ itanium = "itanium",
+ ia32 = "ia32",
+ unknown = "unknown"
+ }
+ export declare enum SendKeyState {
+ press = "press",
+ down = "down",
+ up = "up"
+ }
+ export declare enum NetworkFamily {
+ ipv4 = "ipv4",
+ ipv6 = "ipv6"
+ }
+ export declare enum AccessMode {
+ F_OK = 0,
+ R_OK = 4,
+ W_OK = 2,
+ X_OK = 1
+ }
+ export interface DirectoryEntry {
+ entry: string;
+ path: string;
+ type: string;
+ }
+ export interface FileReaderOptions {
+ pos: number;
+ size: number;
+ }
+ export interface DirectoryReaderOptions {
+ recursive: boolean;
+ }
+ export interface OpenedFile {
+ id: number;
+ eof: boolean;
+ pos: number;
+ lastRead: number;
+ }
+ export interface Stats {
+ size: number;
+ isFile: boolean;
+ isDirectory: boolean;
+ createdAt: number;
+ modifiedAt: number;
+ }
+ export interface Watcher {
+ id: number;
+ path: string;
+ }
+ export interface CopyOptions {
+ recursive: boolean;
+ overwrite: boolean;
+ skip: boolean;
+ }
+ export interface PathParts {
+ rootName: string;
+ rootDirectory: string;
+ rootPath: string;
+ relativePath: string;
+ parentPath: string;
+ filename: string;
+ stem: string;
+ extension: string;
+ }
+ interface Permissions$1 {
+ all: boolean;
+ ownerAll: boolean;
+ ownerRead: boolean;
+ ownerWrite: boolean;
+ ownerExec: boolean;
+ groupAll: boolean;
+ groupRead: boolean;
+ groupWrite: boolean;
+ groupExec: boolean;
+ othersAll: boolean;
+ othersRead: boolean;
+ othersWrite: boolean;
+ othersExec: boolean;
+ }
+ export type PermissionsMode = "ADD" | "REPLACE" | "REMOVE";
+ declare function createDirectory(path: string): Promise<void>;
+ declare function remove(path: string): Promise<void>;
+ declare function writeFile(path: string, data: string): Promise<void>;
+ declare function appendFile(path: string, data: string): Promise<void>;
+ declare function writeBinaryFile(path: string, data: ArrayBuffer): Promise<void>;
+ declare function appendBinaryFile(path: string, data: ArrayBuffer): Promise<void>;
+ declare function readFile(path: string, options?: FileReaderOptions): Promise<string>;
+ declare function readBinaryFile(path: string, options?: FileReaderOptions): Promise<ArrayBuffer>;
+ declare function openFile(path: string): Promise<number>;
+ declare function createWatcher(path: string): Promise<number>;
+ declare function removeWatcher(id: number): Promise<number>;
+ declare function getWatchers(): Promise<Watcher[]>;
+ declare function updateOpenedFile(id: number, event: string, data?: any): Promise<void>;
+ declare function getOpenedFileInfo(id: number): Promise<OpenedFile>;
+ declare function readDirectory(path: string, options?: DirectoryReaderOptions): Promise<DirectoryEntry[]>;
+ declare function copy(source: string, destination: string, options?: CopyOptions): Promise<void>;
+ declare function move(source: string, destination: string): Promise<void>;
+ declare function getStats(path: string): Promise<Stats>;
+ declare function getAbsolutePath(path: string): Promise<string>;
+ declare function getRelativePath(path: string, base?: string): Promise<string>;
+ declare function getPathParts(path: string): Promise<PathParts>;
+ declare function getPermissions(path: string): Promise<Permissions$1>;
+ declare function setPermissions(path: string, permissions: Permissions$1, mode: PermissionsMode): Promise<void>;
+ declare function getJoinedPath(...paths: string[]): Promise<string>;
+ declare function getNormalizedPath(path: string): Promise<string>;
+ declare function getUnnormalizedPath(path: string): Promise<string>;
+ declare function access(path: string, mode?: number): Promise<string>;
+ declare function chmod(path: string, mode: number): Promise<string>;
+ declare function chown(path: string, uid: number, gid: number): Promise<string>;
+ export interface ExecCommandOptions {
+ stdIn?: string;
+ background?: boolean;
+ cwd?: string;
+ }
+ export interface ExecCommandResult {
+ pid: number;
+ stdOut: string;
+ stdErr: string;
+ exitCode: number;
+ }
+ export interface SpawnedProcess {
+ id: number;
+ pid: number;
+ }
+ export interface SpawnedProcessOptions {
+ cwd?: string;
+ envs?: Record<string, string>;
+ }
+ export interface Envs {
+ [key: string]: string;
+ }
+ export interface OpenDialogOptions {
+ multiSelections?: boolean;
+ filters?: Filter[];
+ defaultPath?: string;
+ }
+ export interface FolderDialogOptions {
+ defaultPath?: string;
+ }
+ export interface SaveDialogOptions {
+ forceOverwrite?: boolean;
+ filters?: Filter[];
+ defaultPath?: string;
+ }
+ export interface Filter {
+ name: string;
+ extensions: string[];
+ }
+ export interface TrayOptions {
+ icon: string;
+ menuItems: TrayMenuItem[];
+ useTemplateIcon?: boolean;
+ }
+ export interface TrayMenuItem {
+ id?: string;
+ text: string;
+ isDisabled?: boolean;
+ isChecked?: boolean;
+ }
+ export type KnownPath = "config" | "data" | "cache" | "documents" | "pictures" | "music" | "video" | "downloads" | "savedGames1" | "savedGames2" | "temp";
+ declare function execCommand(command: string, options?: ExecCommandOptions): Promise<ExecCommandResult>;
+ declare function spawnProcess(command: string, options?: SpawnedProcessOptions): Promise<SpawnedProcess>;
+ declare function updateSpawnedProcess(id: number, event: string, data?: any): Promise<void>;
+ declare function getSpawnedProcesses(): Promise<SpawnedProcess[]>;
+ declare function getEnv(key: string): Promise<string>;
+ declare function getEnvs(): Promise<Envs>;
+ declare function showOpenDialog(title?: string, options?: OpenDialogOptions): Promise<string[]>;
+ declare function showFolderDialog(title?: string, options?: FolderDialogOptions): Promise<string>;
+ declare function showSaveDialog(title?: string, options?: SaveDialogOptions): Promise<string>;
+ declare function showNotification(title: string, content: string, icon?: Icon): Promise<void>;
+ declare function showMessageBox(title: string, content: string, choice?: MessageBoxChoice, icon?: Icon): Promise<string>;
+ declare function setTray(options: TrayOptions): Promise<void>;
+ declare function open$1(url: string): Promise<void>;
+ declare function getPath(name: KnownPath): Promise<string>;
+ declare function trashItem(path: string): Promise<string>;
+ export interface MemoryInfo {
+ physical: {
+ total: number;
+ available: number;
+ };
+ virtual: {
+ total: number;
+ available: number;
+ };
+ }
+ export interface KernelInfo {
+ variant: string;
+ version: string;
+ }
+ export interface OSInfo {
+ name: string;
+ description: string;
+ version: string;
Diff truncated. 360 more lines not shown.