From ff8599ec6bd9c6e4009e6ae9bd97b552360b395a Mon Sep 17 00:00:00 2001 From: Fl1tzi Date: Fri, 8 Dec 2023 17:58:18 +0100 Subject: [PATCH] move to lowercase module options, allow changing increment in counter, change name of module init -> new, change env variable for configuration --- src/config.rs | 2 +- src/device.rs | 2 +- src/modules.rs | 18 ++++++++++-------- src/modules/blank.rs | 2 +- src/modules/counter.rs | 13 ++++++++----- src/modules/image.rs | 6 +++--- src/modules/space.rs | 4 ++-- 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/config.rs b/src/config.rs index f33a3c1..eed995a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -180,7 +180,7 @@ impl Button { #[tracing::instrument] pub fn load_config() -> Result { - let config_file: PathBuf = match env::var_os("DACH_DECKER_CONFIG") { + let config_file: PathBuf = match env::var_os("MICRODECK_CONFIG") { Some(path) => { debug!("Using env variable: {:?}", path); PathBuf::from(path) diff --git a/src/device.rs b/src/device.rs index 3df00d1..65b529b 100644 --- a/src/device.rs +++ b/src/device.rs @@ -254,7 +254,7 @@ impl Device { } // switch space if needed if options.0.module == "space" { - let name = match options.0.options.get("NAME") { + let name = match options.0.options.get("name") { Some(n) => n.clone(), None => return, }; diff --git a/src/modules.rs b/src/modules.rs index a651fa6..0323187 100644 --- a/src/modules.rs +++ b/src/modules.rs @@ -41,9 +41,9 @@ pub type ModuleInitFunction = fn(Arc