Skip to content

Commit

Permalink
Add basic connect command
Browse files Browse the repository at this point in the history
  • Loading branch information
LDprg committed Oct 7, 2023
1 parent 15da1b7 commit 437a43c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
20 changes: 17 additions & 3 deletions winapps/src/freerdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,34 @@ pub mod freerdp_back {
pub struct Freerdp {}

impl RemoteClient for Freerdp {
fn check_depends(&self, _config: Config) {
fn check_depends(&self, config: Config) {
let mut xfreerdp = Command::new("xfreerdp");
xfreerdp.stdout(Stdio::null());
xfreerdp.args(["-h"]);
xfreerdp
.spawn()
.expect("Freerdp execution failed! It needs to be installed!");

println!("Freerdp found!");

println!("All dependencies found!");
println!("Running explorer as test!");

self.run_app(config, "explorer");

println!("Test finished!");
}

fn run_app(&self, _config: Config, _app: &str) {
todo!()
fn run_app(&self, config: Config, _app: &str) {
let mut xfreerdp = Command::new("xfreerdp");
xfreerdp.args([
//"/app:".to_owned() + app,
"/d:".to_owned() + &config.rdp.domain,
"/u:".to_owned() + &config.rdp.username,
"/p:".to_owned() + &config.rdp.password,
"/v:".to_owned() + &config.rdp.host,
]);
xfreerdp.spawn().expect("Freerdp execution failed!");
}
}
}
6 changes: 3 additions & 3 deletions winapps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ pub struct HostConfig {

#[derive(new, Debug, Deserialize, Serialize)]
pub struct RemoteConfig {
#[new(value = "\"RDPWindows\".to_string()")]
#[new(value = "\"127.0.0.1\".to_string()")]
host: String,
#[new(value = "\"WORKGROUP\".to_string()")]
domain: String,
#[new(value = "\"RDPUser\".to_string()")]
#[new(value = "\"Quickemu\".to_string()")]
username: String,
#[new(value = "\"RDPPass\".to_string()")]
#[new(value = "\"quickemu\".to_string()")]
password: String,
}

Expand Down

0 comments on commit 437a43c

Please sign in to comment.