anyrun-plugin
The main easy to use crate for creating Anyrun plugins.
Usage
The plugin API is intentionally very simple to use. This is all you need for a plugin:
Cargo.toml:
[lib]
crate-type = ["cdylib"]
[dependencies]
anyrun-plugin = { git = "https://github.com/Kirottu/anyrun" }
abi_stable = "0.11.1"
lib.rs:
use abi_stable::std_types::{RString, RVec, ROption};
use anyrun_plugin::*;
#[init]
fn init(config_dir: RString) {
}
#[info]
fn info() -> PluginInfo {
PluginInfo {
name: "Demo".into(),
icon: "help-about".into(), }
}
#[get_matches]
fn get_matches(input: RString) -> RVec<Match> {
vec![Match {
title: "Test match".into(),
icon: ROption::RSome("help-about".into()),
use_pango: false,
description: ROption::RSome("Test match for the plugin API demo".into()),
id: ROption::RNone, }].into()
}
#[handler]
fn handler(selection: Match) -> HandleResult {
HandleResult::Close
}