#virtual #desktop #process #headless #hidden

transparent

A crate for running processes on a virtual desktop / virtual X server environment

13 releases

0.4.0 Jul 31, 2023
0.3.4 Jun 7, 2023
0.3.3 Nov 25, 2022
0.3.2 Jun 13, 2022
0.1.4 Oct 20, 2021

#360 in Unix APIs

MIT license

23KB
429 lines

transparent

CI crates.io Documentation dependency status MIT

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.

Command::new("some program")
    .spawn_transparent(&TransparentRunner::new())
    .unwrap()
    .wait()
    .unwrap();

How it works

Windows

On windows transparent uses CreateDesktopW to create a new desktop and then spawns a child process using CreateProcessW with lpStartupInfo.lpDesktop set to the new desktop. (Actually a helper process is spawned which then in turn spawns the target process; see virtual-desktop-runner).

Unix

On unix transparent uses xvfb-run which runs the target application in a virtual X server environment.

Known issues

It is currently impossible to determine the specified Stdio of a Command without using mem::transmute or similar, which is why transparent always uses Stdio::piped().

License

Licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT)

Dependencies

~1–11MB
~115K SLoC