{"id":50440719,"url":"https://github.com/cheft/lorealis","last_synced_at":"2026-05-31T19:01:37.563Z","repository":{"id":342459362,"uuid":"1173185243","full_name":"cheft/lorealis","owner":"cheft","description":"The Best Borealis-Powered Lua UI Library for Handheld Computers","archived":false,"fork":false,"pushed_at":"2026-03-16T05:14:10.000Z","size":9989,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-16T11:44:56.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-05T05:02:58.000Z","updated_at":"2026-03-16T05:14:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cheft/lorealis","commit_stats":null,"previous_names":["cheft/lorealis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cheft/lorealis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Florealis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Florealis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Florealis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Florealis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheft","download_url":"https://codeload.github.com/cheft/lorealis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheft%2Florealis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33744447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-31T19:01:36.089Z","updated_at":"2026-05-31T19:01:37.552Z","avatar_url":"https://github.com/cheft.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lorealis \nLorealis is a Lua-enhanced fork of the Borealis UI framework, specifically engineered to be the ultimate UI library for handheld computers and portable devices. Built on top of Borealis' modern, cross-platform UI foundation, Lorealis exposes full-featured UI APIs via Lua 5.1/LuaJIT bindings (powered by Sol2), enabling developers to rapidly build intuitive, responsive, and resource-efficient user interfaces tailored for the constraints of handheld hardware (e.g., limited memory, lower CPU frequency).\nKey strengths include modular XML-based UI layout, pluggable Lua script support, internationalization (i18n) out of the box, and seamless compatibility with popular handheld platforms. Whether for lightweight office tools, RSS readers, markdown viewers, or multimedia applications, Lorealis strikes the perfect balance between ease of development (via Lua's dynamic scripting) and performance (leveraging LuaJIT's JIT compilation), making it the top choice for handheld UI development.\n\n\nController and TV oriented UI library for Android, iOS, PC, PS4, PSV and Nintendo Switch.\n\n- Mimicks the Nintendo Switch system UI, but can also be used to make anything else painlessly\n- Hardware acceleration and vector graphics with automatic scaling for TV usage (powered by nanovg)\n- Can be ported to new platforms and graphics APIs by providing a nanovg implementation\n- Powerful layout engine using flex box as a base for everything (powered by Yoga Layout)\n- Automated navigation paths for out-of-the-box controller navigation\n- Out of the box touch support\n- Define user interfaces using XML and only write code when it matters\n- Use and restyle built-in components or make your own from scratch\n- Display large amount of data efficiently using recycling lists\n- Integrated internationalization and storage systems\n- Integrated toolbox (logger, animations, timers, background tasks...)\n\n## SSH Client Module\n\nLorealis includes a full-featured SSH client module (`mod/ssh`) for cross-platform remote terminal access on both Switch NRO and Desktop.\n\n### Features\n- **Full SSH Protocol**: Password and public key authentication, PTY shell, xterm-256color terminal\n- **ANSI Terminal**: Complete VT100/ANSI escape sequence parser (colors, cursor, scroll regions, 256 colors, true color)\n- **Cross-Platform Input**:\n  - **Switch**: Controller mapping to VT100 sequences (A=keyboard, B=backspace, X=Ctrl+C, Y=EOF, LT/RT=scroll history)\n  - **PC**: Direct physical keyboard input with Ctrl/Alt modifiers\n- **Session Management**: Save connections as JSON, auto-reconnect, fingerprint verification\n- **UTF-8 Support**: Full Unicode rendering with CJK wide character detection\n\n### File Structure\n```\nmod/ssh/\n├── module.ini              # Module metadata\n├── lua/\n│   ├── main.lua            # Entry point\n│   ├── platform.lua        # Platform detection \u0026 key mappings\n│   ├── ansi_parser.lua     # ANSI escape sequence parser\n│   ├── terminal_buffer.lua # Terminal screen buffer\n│   ├── ssh_manager.lua     # SSH session lifecycle\n│   ├── keyboard.lua        # Switch swkbd \u0026 controller input\n│   ├── terminal_view.lua   # NanoVG terminal rendering\n│   ├── connection_view.lua # Connection list UI\n│   └── saved_connections.lua # JSON persistence\n└── xml/\n    ├── connect.xml         # Connection list layout\n    └── terminal.xml        # Terminal layout\n```\n\n### Lua API\n```lua\nlocal ssh = require(\"ssh_manager\")\nlocal session = ssh.new()\nsession:connect({\n    host = \"192.168.1.1\",\n    port = 22,\n    user = \"root\",\n    password = \"secret\",\n    cols = 100,\n    rows = 36\n})\nsession:send(\"ls -la\\r\")\n```\n\n### Build Requirements\n- **Switch**: devkitPro with `libssh2` (`dkp-pacman -S switch-libssh2`)\n- **Desktop**: CMake will auto-fetch libssh2 if not found via pkgconfig\n\n---\n\n## Windows build\n```PowerShell\n1. Clear cache\nRemove-Item -Recurse -Force build\n2. Configure\ncmake -B build -G \"Visual Studio 16 2019\" -DPLATFORM_DESKTOP=ON\n3. Build\ncmake --build build --config Release\n\n\ncmake -B build -DMPV_DIR=\"e:/Works/Projects/ns-chat/extern/mpv-dev\" . \ncmake --build build --config Release\n\n\"C:\\Program Files\\CMake\\bin\\cmake.exe\" -B build -G \"Visual Studio 16 2019\" -DPLATFORM_DESKTOP=ON\n\"C:\\Program Files\\CMake\\bin\\cmake.exe\" --build build --config Release\n```\n\n## Linux BUild\n```shell\nsudo apt install -y build-essential cmake pkg-config git libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libxkbcommon-dev libdbus-1-dev libgl1-mesa-dev libegl1-mesa-dev\n\ncmake -B build -DPLATFORM_DESKTOP=ON -DGLFW_BUILD_X11=ON -DGLFW_BUILD_WAYLAND=OFF\n```\n\n### Mac Build\n```shell\ncmake --build build --config Release\n\n```\n\n\n## NRO Build (Docker)\n\n### PowerShell\n```powershell\ndocker run --rm -v \"${PWD}:/data\" devkitpro/devkita64:20260219 bash -c \"/data/build_switch.sh\"\n\n# fast repack for lua or xml changed\ndocker run --rm -v \"${PWD}:/data\" devkitpro/devkita64:20260219 bash -c \"/data/scripts/repack_switch_romfs.sh\"\n\n# copy to ns\ndocker run --rm -it -v \"${PWD}/build_switch\":/work devkitpro/devkita64:20260219 bash\n\n/opt/devkitpro/tools/bin/nxlink -a 192.168.31.91 /work/lorealis.nro\n\n```\n\n\n## TODO\n- [x] Lua integration is being gradually refined\n- [x] Markdown \u0026 HTML renderer is not perfect\n- [x] RSS reader (first version) is completed\n- [x] SSH remote tool (first version) is completed\n- [ ] Theme Compatibility\n- [ ] I18n Bundle Lazy Loading\n- [ ] Luajit Tests\n- [ ] Component Enhancement \n\n## Screenshots\n\u003cp align=\"center\"\u003e\n  \u003c!-- 纯内联样式实现两列瀑布流，适配GitHub渲染规则 --\u003e\n  \u003cdiv style=\"column-count: 2; column-gap: 10px; max-width: 900px; margin: 0 auto;\"\u003e\n     \u003cimg src=\"./demo_screens/keyboard1.png\" alt=\"游戏截图1\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/keyboard2.png\" alt=\"游戏截图2\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/2051030715381500-724B210A3FADE4CB2EC3B689F6D30AA5.jpg\" alt=\"游戏截图1\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/2051030715383600-724B210A3FADE4CB2EC3B689F6D30AA5.jpg\" alt=\"游戏截图2\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/2051030715385100-724B210A3FADE4CB2EC3B689F6D30AA5.jpg\" alt=\"游戏截图3\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/2051030715385700-724B210A3FADE4CB2EC3B689F6D30AA5.jpg\" alt=\"游戏截图4\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/2051030715404700-724B210A3FADE4CB2EC3B689F6D30AA5.jpg\" alt=\"游戏截图5\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/2051030715405400-724B210A3FADE4CB2EC3B689F6D30AA5.jpg\" alt=\"游戏截图6\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/ScreenShot_2026-03-06_160039_853.png\" alt=\"游戏截图7\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/ScreenShot_2026-03-06_160157_228.png\" alt=\"游戏截图9\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/ScreenShot_2026-03-06_160325_175.png\" alt=\"游戏截图10\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/ScreenShot_2026-03-06_160145_795.png\" alt=\"游戏截图8\" style=\"width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; border-radius: 4px;\"\u003e\n    \u003cimg src=\"./demo_screens/ScreenShot_2026-03-06_160414_653.png\" alt=\"游戏截图11\" style=\"width: 100%; height: auto; break-inside: avoid; border-radius: 4px;\"\u003e\n  \u003c/div\u003e\n\u003c/p\u003e\n\n## Credits \n- Thanks to [Natinusala](https://github.com/natinusala), [xfangfang](https://github.com/xfangfang) and [XITRIX](https://github.com/XITRIX) for [borealis](https://github.com/xfangfang/borealis)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheft%2Florealis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheft%2Florealis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheft%2Florealis/lists"}