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

Macros

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

Structs

  • An icon for an Item.
  • An Alfred script filter item.
  • The modifier settings for an Item when a modifier key is pressed.
  • The output of a workflow (i.e. input for the script filter)

Enums

  • A keyboard modifier key.
  • The type of item.
  • Represents any valid JSON value.

Functions

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