Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ windows-sys = { version = "0.61", features = [
"Win32_System_Diagnostics_ToolHelp",
"Win32_System_IO",
"Win32_System_JobObjects",
# The pipes camless drives the LCD's browser through.
"Win32_System_Pipes",
"Win32_System_Registry",
"Win32_System_SystemInformation",
"Win32_System_Threading",
Expand Down
8 changes: 7 additions & 1 deletion docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ Nexus has an MCP server for its cooling too, and this one was inspired by it.
- `window.nzxt.v1` has `width`, `height`, `shape` and `targetFps`, and `window.nzxt.v1.onMonitoringDataUpdate` gets CAM's monitoring object every second;
- what the page draws goes to the screen at up to `fps` frames per second, and a page that stops changing is sent again every second.

The browser runs as the signed-in user even when camless runs as administrator, with its own profile in `%LOCALAPPDATA%\camless\browser` (on Linux `~/.local/share/camless/browser`), and it ends with camless. Its window sits off every screen: headless Chromium still makes one on Windows, and some versions show it as a blank white square on the desktop. On Linux camless drives it through two pipes (`--remote-debugging-pipe`) rather than a debugging port on 127.0.0.1, which other users of the computer could reach too. If the page does not load, the screen shows liquid temperature and camless tries again every 10 s. `camless lcd page URL` renders a page once, without a device, to check it.
The browser runs as the signed-in user even when camless runs as administrator, with its own profile in `%LOCALAPPDATA%\camless\browser` (on Linux `~/.local/share/camless/browser`), and it ends with camless. Its window sits off every screen: headless Chromium still makes one on Windows, and some versions show it as a blank white square on the desktop. camless drives it through two pipes (`--remote-debugging-pipe`) rather than a debugging port on 127.0.0.1, which every user and program on the computer could reach too. On Windows the browser takes the pipes as two inherited handles (`--remote-debugging-io-pipes`), which needs Edge or Chrome 118 or newer. If the page does not load, the screen shows liquid temperature and camless tries again every 10 s. `camless lcd page URL` renders a page once, without a device, to check it.

A camless that runs as administrator starts the browser as a child of Explorer, so it gets the signed-in user's rights and can still inherit the pipes. Windows then writes who may open the new process, its first thread and its token from camless's administrator token, and camless puts all three back to what Explorer's own children get. What did not work:

- `CreateProcessWithTokenW` with Explorer's token, which camless used with the debugging port: it passes no handles on, so the browser cannot get its pipes.
- Explorer as the parent with nothing else changed: Edge 157 could not copy its own token for its sandbox, logged "GPU process launch failed: error_code=49" (`SBOX_ERROR_CANNOT_CREATE_RESTRICTED_TOKEN`) and stopped at a breakpoint dialog on the desktop.
- The token put right but not the process: the page rendered, but the process kept an administrator program's integrity level, and Edge could not open itself to start its crash handler.

A browser is the heavy part of camless: KrakenDial with a video background takes Edge about 170 MB of memory and 40 % of one CPU core. Edge runs without a GPU, as CAM's Web Integration does, which saves it about 150 MB. The other LCD modes need no browser.

Expand Down
Loading