more todos and create config dir per plugin

This commit is contained in:
Gvidas Juknevičius 2024-06-21 00:04:11 +03:00
parent 7f6920507c
commit 8349316169
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
2 changed files with 5 additions and 3 deletions

View File

@ -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();

View File

@ -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)
}
}