Con LotOS UI · Desktop Multi-Lenguaje
1 shell.html. 5 lenguajes. El mismo look. El CLI genera ui/shell.html + el archivo host en tu lenguaje elegido. Tu app nativa solo abre un WebView. LotOS hace todo lo visual.
Cómo funciona el bridge
El shell.html llama a window.lotosDesktopBridge.call(method, params). Tu host app registra ese bridge. Python usa js_api=ApiBridge(), Rust usa lotosBridge.invoke, Java/C/C++ usan la misma interfaz JSON.
{ id, method, params } →
host app
↓
{ id, ok, result }
Python app.py
mismo shell.html ui/shell.html — generado por CLI
LotOS Desktop — Control Center Python LotOS Desktop
free
Template
Control Center Components
KPI Rail Command Table Stats
Runtimes
Python Rust Java C C++
Control Center Desktop
Desktop starter with LotOS visual system + bridge contract
Open Command Palette KPI Rail 01
KPI Rail module Template: Control Center
Command Panel 02
Command Panel module Template: Control Center
Activity Feed 03
Activity Feed module Template: Control Center
System Status 04
System Status module Template: Control Center
app.py — app host (Python)
import webview
from pathlib import Path
ROOT = Path(__file__).resolve().parent
HTML = ROOT / "ui" / "shell.html"
class ApiBridge:
def invoke(self, payload):
return {"id": payload.get("id"), "ok": True,
"result": {"echo": payload}}
if __name__ == "__main__":
webview.create_window(
"LotOS Desktop", HTML.as_uri(),
js_api=ApiBridge(), width=1360, height=860
)
webview.start(debug=True)
requirements.txt: pywebview==5.2
pip install pywebview && python app.py
CLI — generar este proyecto
lotos-ui desktop-init -l python -t control-center-desktop -o ./my-app
Rust src/main.rs
mismo shell.html ui/shell.html — generado por CLI
LotOS Desktop — Control Center Rust LotOS Desktop
free
Template
Control Center Components
KPI Rail Command Table Stats
Runtimes
Python Rust Java C C++
Control Center Desktop
Desktop starter with LotOS visual system + bridge contract
Open Command Palette KPI Rail 01
KPI Rail module Template: Control Center
Command Panel 02
Command Panel module Template: Control Center
Activity Feed 03
Activity Feed module Template: Control Center
System Status 04
System Status module Template: Control Center
src/main.rs — app host (Rust)
use std::path::PathBuf;
use wry::application::event::{Event, WindowEvent};
use wry::application::event_loop::{ControlFlow, EventLoop};
use wry::application::window::WindowBuilder;
use wry::webview::WebViewBuilder;
fn main() -> wry::Result<()> {
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_title("LotOS Desktop")
.build(&event_loop)?;
let html_path: PathBuf = std::env::current_dir()?
.join("ui").join("shell.html");
let url = format!("file:///{}", html_path.to_string_lossy());
let _webview = WebViewBuilder::new(window)?
.with_url(&url)?.build()?;
event_loop.run(move |event, _, control_flow| {
*control_flow = ControlFlow::Wait;
if let Event::WindowEvent {
event: WindowEvent::CloseRequested, .. } = event {
*control_flow = ControlFlow::Exit;
}
});
}
Cargo.toml: wry = "0.45"
cargo run
CLI — generar este proyecto
lotos-ui desktop-init -l rust -t control-center-desktop -o ./my-app
Java App.java
mismo shell.html ui/shell.html — generado por CLI
LotOS Desktop — Control Center Java LotOS Desktop
free
Template
Control Center Components
KPI Rail Command Table Stats
Runtimes
Python Rust Java C C++
Control Center Desktop
Desktop starter with LotOS visual system + bridge contract
Open Command Palette KPI Rail 01
KPI Rail module Template: Control Center
Command Panel 02
Command Panel module Template: Control Center
Activity Feed 03
Activity Feed module Template: Control Center
System Status 04
System Status module Template: Control Center
App.java — app host (Java)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import java.io.File;
public class App extends Application {
@Override
public void start(Stage stage) {
WebView web = new WebView();
String url = new File("ui/shell.html")
.toURI().toString();
web.getEngine().load(url);
stage.setTitle("LotOS Desktop");
stage.setScene(new Scene(web, 1360, 860));
stage.show();
}
public static void main(String[] args) {
launch();
}
}
JDK 21+ with JavaFX modules
javac App.java && java --module-path $FX_PATH App
CLI — generar este proyecto
lotos-ui desktop-init -l java -t control-center-desktop -o ./my-app
ui/shell.html — generado por CLI
LotOS Desktop — Control Center C LotOS Desktop
free
Template
Control Center Components
KPI Rail Command Table Stats
Runtimes
Python Rust Java C C++
Control Center Desktop
Desktop starter with LotOS visual system + bridge contract
Open Command Palette KPI Rail 01
KPI Rail module Template: Control Center
Command Panel 02
Command Panel module Template: Control Center
Activity Feed 03
Activity Feed module Template: Control Center
System Status 04
System Status module Template: Control Center
main.c — app host (C)
#include <webview/webview.h>
int main(void) {
webview_t w = webview_create(0, NULL);
webview_set_title(w, "LotOS Desktop");
webview_set_size(w, 1360, 860,
WEBVIEW_HINT_NONE);
webview_navigate(w,
"file:///./ui/shell.html");
webview_run(w);
webview_destroy(w);
return 0;
}
webview/webview.h (single-header)
gcc main.c -o app -lwebview && ./app
CLI — generar este proyecto
lotos-ui desktop-init -l c -t control-center-desktop -o ./my-app
C++ main.cpp
mismo shell.html ui/shell.html — generado por CLI
LotOS Desktop — Control Center C++ LotOS Desktop
free
Template
Control Center Components
KPI Rail Command Table Stats
Runtimes
Python Rust Java C C++
Control Center Desktop
Desktop starter with LotOS visual system + bridge contract
Open Command Palette KPI Rail 01
KPI Rail module Template: Control Center
Command Panel 02
Command Panel module Template: Control Center
Activity Feed 03
Activity Feed module Template: Control Center
System Status 04
System Status module Template: Control Center
main.cpp — app host (C++)
#include <webview/webview.h>
int main() {
webview::webview w(true, nullptr);
w.set_title("LotOS Desktop");
w.set_size(1360, 860,
WEBVIEW_HINT_NONE);
w.navigate(
"file:///./ui/shell.html");
w.run();
}
webview C++ wrapper (header-only)
g++ -std=c++17 main.cpp -o app -lwebview && ./app
CLI — generar este proyecto
lotos-ui desktop-init -l cpp -t control-center-desktop -o ./my-app
Estructura generada — igual para todos los lenguajes
my-app/
├── ui/
│ └── shell.html ← LotOS
├── app.py
└── desktop-template.json
my-app/
├── ui/
│ └── shell.html ← LotOS
├── src/main.rs
└── desktop-template.json
my-app/
├── ui/
│ └── shell.html ← LotOS
├── App.java
└── desktop-template.json
my-app/
├── ui/
│ └── shell.html ← LotOS
├── main.c
└── desktop-template.json
my-app/
├── ui/
│ └── shell.html ← LotOS
├── main.cpp
└── desktop-template.json
1 shell.html · LotOS light theme
5 host languages
WebView bridge contract
lotos-ui desktop-init
Full Signature preview