pub fn kill_steamvr() {
    let mut system = System::new_with_specifics(RefreshKind::new().with_processes());
    system.refresh_processes();

    // first kill vrmonitor, then kill vrserver if it is hung.

    for process in system.process_by_name(&afs::exec_fname("vrmonitor")) {
        #[cfg(not(windows))]
        process.kill(sysinfo::Signal::Term);
        #[cfg(windows)]
        kill_process(process.pid());
    }

    thread::sleep(Duration::from_secs(1));

    for process in system.process_by_name(&afs::exec_fname("vrserver")) {
        #[cfg(not(windows))]
        process.kill(sysinfo::Signal::Term);
        #[cfg(windows)]
        kill_process(process.pid());
    }
}
// this will not kill the child process "ALVR launcher"
this will not kill the child process "ALVR launcher"
this will not kill the child process " ALVR launcher "
pub fn kill_steamvr() {
    let mut system = System::new_with_specifics(RefreshKind::new().with_processes());
    system.refresh_processes();
    // first kill vrmonitor, then kill vrserver if it is hung.
    for process in system.process_by_name(&afs::exec_fname("vrmonitor")) {
        #[cfg(not(windows))]
        process.kill(sysinfo::Signal::Term);
        #[cfg(windows)]
        kill_process(process.pid());
    }
    thread::sleep(Duration::from_secs(1));
    for process in system.process_by_name(&afs::exec_fname("vrserver")) {
        #[cfg(not(windows))]
        process.kill(sysinfo::Signal::Term);
        #[cfg(windows)]
        kill_process(process.pid());
    }
}
pub fn kill_steamvr ( ) { let mut system = System :: new_with_specifics ( RefreshKind :: new ( ) . with_processes ( ) ) ; system . refresh_processes ( ) ; // first kill vrmonitor, then kill vrserver if it is hung. for process in system . process_by_name ( & afs :: exec_fname ( " " ) ) { # [ cfg ( not ( windows ) ) ] process . kill ( sysinfo :: Signal :: Term ) ; # [ cfg ( windows ) ] kill_process ( process . pid ( ) ) ; } thread :: sleep ( Duration :: from_secs ( 1 ) ) ; for process in system . process_by_name ( & afs :: exec_fname ( " " ) ) { # [ cfg ( not ( windows ) ) ] process . kill ( sysinfo :: Signal :: Term ) ; # [ cfg ( windows ) ] kill_process ( process . pid ( ) ) ; } }
this will not kill the child process "ALVR launcher"
this will not kill the child process " ALVR launcher "