From 8349316169ac656ade79c47cbd0a18120059944e Mon Sep 17 00:00:00 2001 From: MCorange Date: Fri, 21 Jun 2024 00:04:11 +0300 Subject: [PATCH] more todos and create config dir per plugin --- src/main.rs | 1 + src/plugman/plugin/mod.rs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index fd5810f..60228b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,7 @@ pub type c_str = *const c_char; // TODO: Make ffi safe abstraction for logger // TODO: Set up ipc with unix sockets // TODO: Allow sending messages command -> running DIM instance -> plugin with ipc +// TODO: Clickable bar: https://dwm.suckless.org/patches/statuscmd/ // TODO: Run code through clippy fn main() -> ExitCode { let ca = CliArgs::parse(); diff --git a/src/plugman/plugin/mod.rs b/src/plugman/plugin/mod.rs index e209015..0fc47ab 100644 --- a/src/plugman/plugin/mod.rs +++ b/src/plugman/plugin/mod.rs @@ -40,10 +40,11 @@ impl Plugin { } pub fn init(&self, cfg: &Config) { + let conf_dir = &cfg.config_dir.join(self.name()).to_string_lossy().to_string(); + let _ = std::fs::create_dir(&conf_dir); // dont care + let ctx = PluginContextContainer::new(conf_dir); + unsafe { - let conf_dir = &cfg.config_dir.join(self.name()).to_string_lossy().to_string(); - - let ctx = PluginContextContainer::new(conf_dir); (self.syms().init)(&ctx.inner as *const PluginContext) } }