diff --git a/Cargo.toml b/Cargo.toml index f79c5e2..218853d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "virtual-deck" +name = "microdeck" version = "0.1.0" edition = "2021" license = "MIT" @@ -7,11 +7,11 @@ license = "MIT" [dependencies] hidapi = "2.2.0" deck-driver = { git = "https://codeberg.org/Fl1tzi/deck-driver.git", branch = "main", features = ["async"] } -toml = "0.7.2" tokio = { version = "1", features = ["full"] } log = "0.4" dirs = "4.0.0" serde = { version = "1.0", features = ["derive", "rc"] } +serde_json = "1.0" image = "0.24.5" async-trait = "0.1.66" futures-util = "0.3.27" diff --git a/src/config.rs b/src/config.rs index 4136aa3..d87d37a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,9 +10,11 @@ use std::{ sync::Arc }; use tracing::debug; +use serde_json; /// The name of the folder which holds the config -pub const CONFIG_FOLDER_NAME: &'static str = "virtual-deck"; +pub const CONFIG_FOLDER_NAME: &'static str = "microdeck"; +pub const CONFIG_FILE: &'static str = "config.json"; #[derive(Deserialize, Debug)] pub struct Config { @@ -58,7 +60,7 @@ pub fn load_config() -> Result { // try to get the system config dir; env var required if not available if let Some(mut path) = config_dir() { path.push(CONFIG_FOLDER_NAME); - path.push("config.toml"); + path.push(CONFIG_FILE); debug!("Using system path: {:?}", path); path } else { @@ -71,7 +73,7 @@ pub fn load_config() -> Result { match fs::read_to_string(config_file) { Ok(content) => { - toml::from_str(&content).map_err(|e| ConfigError::SyntaxError(e.to_string())) + serde_json::from_str(&content).map_err(|e| ConfigError::SyntaxError(e.to_string())) } Err(file_error) => { if file_error.kind() == ErrorKind::NotFound {