fix names
This commit is contained in:
parent
8693e10979
commit
43a07debde
|
@ -1,7 +1,7 @@
|
||||||
# Must match package name in Cargo.toml
|
# Must match package name in Cargo.toml
|
||||||
PLUGIN_NAME=battery
|
PLUGIN_NAME=battery
|
||||||
# `target` or `debug`
|
# `release` or `debug`
|
||||||
TYPE=target
|
TYPE=release
|
||||||
|
|
||||||
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,4 @@ crate-type=["cdylib"]
|
||||||
chrono = "0.4.38"
|
chrono = "0.4.38"
|
||||||
dim_sdk = {path="../../sdk/rust/"}
|
dim_sdk = {path="../../sdk/rust/"}
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
|
log = "0.4.21"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Must match package name in Cargo.toml
|
# Must match package name in Cargo.toml
|
||||||
PLUGIN_NAME=clock
|
PLUGIN_NAME=clock
|
||||||
# `target` or `debug`
|
# `release` or `debug`
|
||||||
TYPE=target
|
TYPE=release
|
||||||
|
|
||||||
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ use dim_sdk::{plugin_info, DimPlugin};
|
||||||
|
|
||||||
plugin_info!(
|
plugin_info!(
|
||||||
Plug, // Your main global structs name that implements `DimPlugin`
|
Plug, // Your main global structs name that implements `DimPlugin`
|
||||||
"Clock", // Plugin name
|
"clock", // Plugin name
|
||||||
"0.0.0", // Plugin Version (leave empty for none)
|
"0.0.0", // Plugin Version (leave empty for none)
|
||||||
"GPLv3" // Plugin license (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<()> {
|
fn poll(&mut self, f: &mut dim_sdk::CBuffer) -> dim_sdk::Result<()> {
|
||||||
let local: DateTime<Local> = Local::now();
|
let local: DateTime<Local> = Local::now();
|
||||||
let formatted_time = local.format("%H:%M (%Y-%m-%d)").to_string();
|
let formatted_time = local.format("%H:%M (%Y-%m-%d)").to_string();
|
||||||
|
log::info!("Hello from clocky :3");
|
||||||
write!(f, "Time: {}", formatted_time)?;
|
write!(f, "Time: {}", formatted_time)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Must match package name in Cargo.toml
|
# Must match package name in Cargo.toml
|
||||||
PLUGIN_NAME=counter
|
PLUGIN_NAME=counter
|
||||||
# `target` or `debug`
|
# `release` or `debug`
|
||||||
TYPE=target
|
TYPE=release
|
||||||
|
|
||||||
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,7 @@ impl Plug {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DimPlugin for 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<()> {
|
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");
|
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())?;
|
write!(f, "{} days <3", duration.num_days())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
fn pre_reload(&mut self) {
|
fn pre_reload(&mut self) {}
|
||||||
}
|
fn post_reload(&mut self) {}
|
||||||
fn post_reload(&mut self) {
|
fn free(&mut self) {}
|
||||||
}
|
|
||||||
fn free(&mut self) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "dim_sdk.h"
|
#include "dim_sdk.h"
|
||||||
|
|
||||||
PLUG_INFO("Example plugin", "0.0.1", "GPLv3")
|
PLUG_INFO("example_c", "0.0.1", "GPLv3")
|
||||||
|
|
||||||
typedef struct plug_t {
|
typedef struct plug_t {
|
||||||
char* some_data;
|
char* some_data;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# Must match package name in Cargo.toml
|
# Must match package name in Cargo.toml
|
||||||
PLUGIN_NAME=example_rust
|
PLUGIN_NAME=example_rust
|
||||||
# `target` or `debug`
|
# `release` or `debug`
|
||||||
TYPE=target
|
TYPE=release
|
||||||
|
|
||||||
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
build: $(PLUGIN_DIR)/$(PLUGIN_NAME).dim
|
||||||
|
|
||||||
$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so
|
$(PLUGIN_DIR)/$(PLUGIN_NAME).dim: $(OBJECT_DIR)/$(PLUGIN_NAME)/$(TYPE)/lib$(PLUGIN_NAME).so
|
||||||
|
|
|
@ -3,7 +3,7 @@ use dim_sdk::{plugin_info, DimPlugin};
|
||||||
|
|
||||||
plugin_info!(
|
plugin_info!(
|
||||||
Plug, // Your main global structs name that implements `DimPlugin`
|
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)
|
"0.0.0", // Plugin Version (leave empty for none)
|
||||||
"GPLv3" // Plugin license (leave empty for none)
|
"GPLv3" // Plugin license (leave empty for none)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user