fix names

This commit is contained in:
Gvidas Juknevičius 2024-06-20 12:06:18 +03:00
parent 8693e10979
commit 43a07debde
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
9 changed files with 18 additions and 20 deletions

View File

@ -1,7 +1,7 @@
# Must match package name in Cargo.toml
PLUGIN_NAME=battery
# `target` or `debug`
TYPE=target
# `release` or `debug`
TYPE=release
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim

View File

@ -11,3 +11,4 @@ crate-type=["cdylib"]
chrono = "0.4.38"
dim_sdk = {path="../../sdk/rust/"}
lazy_static = "1.4.0"
log = "0.4.21"

View File

@ -1,7 +1,7 @@
# Must match package name in Cargo.toml
PLUGIN_NAME=clock
# `target` or `debug`
TYPE=target
# `release` or `debug`
TYPE=release
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim

View File

@ -4,7 +4,7 @@ use dim_sdk::{plugin_info, DimPlugin};
plugin_info!(
Plug, // Your main global structs name that implements `DimPlugin`
"Clock", // Plugin name
"clock", // Plugin name
"0.0.0", // Plugin Version (leave empty for none)
"GPLv3" // Plugin license (leave empty for none)
);
@ -26,7 +26,7 @@ impl DimPlugin for Plug {
fn poll(&mut self, f: &mut dim_sdk::CBuffer) -> dim_sdk::Result<()> {
let local: DateTime<Local> = Local::now();
let formatted_time = local.format("%H:%M (%Y-%m-%d)").to_string();
log::info!("Hello from clocky :3");
write!(f, "Time: {}", formatted_time)?;
Ok(())
}

View File

@ -1,7 +1,7 @@
# Must match package name in Cargo.toml
PLUGIN_NAME=counter
# `target` or `debug`
TYPE=target
# `release` or `debug`
TYPE=release
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim

View File

@ -21,8 +21,7 @@ impl Plug {
}
impl DimPlugin for Plug {
fn init(&mut self) {
}
fn init(&mut self) {}
fn poll(&mut self, f: &mut dim_sdk::CBuffer) -> dim_sdk::Result<()> {
let start_date = NaiveDate::from_ymd_opt(2024, 3, 8).expect("Invalid date");
@ -32,12 +31,9 @@ impl DimPlugin for Plug {
write!(f, "{} days <3", duration.num_days())?;
Ok(())
}
fn pre_reload(&mut self) {
}
fn post_reload(&mut self) {
}
fn free(&mut self) {
}
fn pre_reload(&mut self) {}
fn post_reload(&mut self) {}
fn free(&mut self) {}
}

View File

@ -4,7 +4,7 @@
#include "dim_sdk.h"
PLUG_INFO("Example plugin", "0.0.1", "GPLv3")
PLUG_INFO("example_c", "0.0.1", "GPLv3")
typedef struct plug_t {
char* some_data;

View File

@ -1,7 +1,8 @@
# Must match package name in Cargo.toml
PLUGIN_NAME=example_rust
# `target` or `debug`
TYPE=target
# `release` or `debug`
TYPE=release
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so

View File

@ -3,7 +3,7 @@ use dim_sdk::{plugin_info, DimPlugin};
plugin_info!(
Plug, // Your main global structs name that implements `DimPlugin`
"Example rust project", // Plugin name
"example_rust", // Plugin name
"0.0.0", // Plugin Version (leave empty for none)
"GPLv3" // Plugin license (leave empty for none)
);