https://github.com/openbytedev/transparent
A rust crate for running processes on a virtual desktop / virtual X server environment.
https://github.com/openbytedev/transparent
Last synced: about 1 year ago
JSON representation
A rust crate for running processes on a virtual desktop / virtual X server environment.
- Host: GitHub
- URL: https://github.com/openbytedev/transparent
- Owner: OpenByteDev
- License: mit
- Created: 2021-10-13T01:00:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-31T20:27:58.000Z (over 2 years ago)
- Last Synced: 2025-04-14T03:05:55.425Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 62.5 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# transparent
[](https://github.com/OpenByteDev/transparent/actions/workflows/ci.yml)
[](https://crates.io/crates/transparent)
[](https://docs.rs/transparent)
[](https://deps.rs/repo/github/openbytedev/transparent)
[](https://github.com/OpenByteDev/transparent/blob/master/LICENSE)
A crate for running processes on a virtual desktop / virtual X server environment.
## Usage
This will spawn `some program` on a new virtual desktop / virtual X server environment.
```rust
Command::new("some program")
.spawn_transparent(&TransparentRunner::new())
.unwrap()
.wait()
.unwrap();
```
## How it works
### Windows
On windows `transparent` uses [`CreateDesktopW`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createdesktopw) to create a new desktop and then spawns a child process using [`CreateProcessW`](https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw) with [`lpStartupInfo.lpDesktop`](https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfow#syntax) set to the new desktop. (Actually a helper process is spawned which then in turn spawns the target process; see [`virtual-desktop-runner`](https://github.com/OpenByteDev/transparent/tree/master/virtual-desktop-runner)).
### Unix
On unix `transparent` uses [`xvfb-run`](http://manpages.ubuntu.com/manpages/trusty/man1/xvfb-run.1.html) which runs the target application in a virtual X server environment.
## Known issues
It is currently impossible to determine the specified [`Stdio`](https://doc.rust-lang.org/std/process/struct.Stdio.html) of a [`Command`](https://doc.rust-lang.org/std/process/struct.Command.html) without using [`mem::transmute`](https://doc.rust-lang.org/std/mem/fn.transmute.html) or similar, which is why `transparent` always uses [`Stdio::piped()`](https://doc.rust-lang.org/std/process/struct.Stdio.html#method.piped).
## License
Licensed under the MIT license ([LICENSE](https://github.com/OpenByteDev/transparent/blob/master/LICENSE) or http://opensource.org/licenses/MIT)