user in gui template

master
bel 2023-03-24 23:55:15 -06:00
parent 357d35f787
commit 451a1c43a3
2 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,7 @@ pub struct GUI {
pub press: PreSufFix,
pub release: PreSufFix,
pub format: Option<String>,
pub user: String,
}
#[derive(Serialize, Deserialize, Debug)]
@ -129,6 +130,7 @@ fn build_config_std() -> Config {
prefix: env::var("INPUT_GUI_RELEASE_PREFIX").unwrap_or(String::from("")),
suffix: env::var("INPUT_GUI_RELEASE_SUFFIX").unwrap_or(String::from("")),
},
user: env::var("INPUT_GUI_USER").unwrap_or(String::from("me")),
format: match env::var("INPUT_GUI_FORMAT") {
Ok(x) => Some(x),
Err(_) => match env::var("INPUT_GUI_FORMAT_V01").unwrap_or(String::from("false")) == String::from("true") {

View File

@ -150,7 +150,7 @@ impl Main {
"pressed": pressed.iter().collect::<String>(),
"released": released.iter().collect::<String>(),
"ms": SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis(),
"user": String::from(""),
"user": self.flags.cfg.user,
})).unwrap().chars().collect();
},
None => {