Crate powerpack

Source
Expand description

⚡ Supercharge your Alfred workflows by building them in Rust!

§Introduction

This crate provides types for developing script filter Alfred workflows in Rust. Additionally, this project includes the powerpack-cli crate which contains a command-line tool to help build and install your workflows.

Types in this crate closely mirror the script filter JSON format. View the official documentation for that here.

§Examples

Each row in an Alfred script filter result is represented by an Item. A workflow must output a sequence of items to stdout using the output() function.

use std::iter;

let item = powerpack::Item::new("Example title")
    .subtitle("example subtitle")
    .arg("example");

powerpack::output(iter::once(item))?;

Re-exports§

pub use powerpack_env as env;

Macros§

value
Construct a serde_json::Value from a JSON literal.

Structs§

Cache
The Alfred cache settings for an Output.
Icon
An icon for an Item.
Item
An Alfred script filter item.
Modifier
The modifier settings for an Item when a modifier key is pressed.
Output
The Alfred script filter workflow output.

Enums§

Key
A keyboard modifier key.
Kind
The type of item.
Value
Represents any valid JSON value.

Functions§

output
Shortcut function to output a list of items to stdout.