A wayland native, highly customizable runner.

Related tags

Command-line anyrun
Overview

anyrun

A wayland native krunner-like runner, made with customizability in mind.

Features

  • Style customizability with GTK+ CSS
  • Can do basically anything
    • As long as it can work with input and selection
    • Hence the name anyrun
  • Easy to make plugins
    • You only need 4 functions!
    • See Rink for a simple example. More info in the documentation of the anyrun-plugin crate.
  • Responsive
    • Asynchronous running of plugin functions
  • Wayland native
    • GTK layer shell for overlaying the window
    • data-control for managing the clipboard

Usage

Dependencies

Anyrun mainly depends various GTK libraries, and rust of course for building the project. Rust you can get with rustup. The rest are statically linked in the binary. Here are the libraries you need to have to build & run it:

  • gtk-layer-shell (libgtk-layer-shell)
  • gtk3 (libgtk-3 libgdk-3)
  • pango (libpango-1.0)
  • cairo (libcairo libcairo-gobject)
  • gdk-pixbuf2 (libgdk_pixbuf-2.0)
  • glib2 (libgobject-2.0 libgio-2.0 libglib-2.0)

Installation

Make sure all of the dependencies are installed, and then run the following commands in order:

git clone https://github.com/Kirottu/anyrun.git # Clone the repository
cd anyrun # Change the active directory to it
cargo build --release # Build all the packages
cargo install --path anyrun/ # Install the anyrun binary
mkdir -p ~/.config/anyrun/plugins # Create the config directory and the plugins subdirectory
cp target/release/*.so ~/.config/anyrun/plugins # Copy all of the built plugins to the correct directory

After that you need to create the configuration file and place it in ~/.config/anyrun/config.ron. A config file with all of the included plugins is as follows:

Config(
  width: 800,
  plugins: [
    "libapplications.so",
    "libsymbols.so",
    "libshell.so",
    "libtranslate.so",
  ],
)

Plugins

Anyrun requires plugins to function, as they provide the results for input. The list of plugins in this repository is as follows:

Configuration

The default configuration directory is $HOME/.config/anyrun the structure of the config directory is as follows and should be respected by plugins:

- anyrun
  - plugins
    <plugin dynamic libraries>
  config.ron
  style.css
  <any plugin specific config files>

The config file has the following structure, and as seen in the name uses the ron language:

Config(
  width: 800, // The width of the window
  plugins: [
    "libapplications.so", // Relative paths are looked up in the <config dir>/plugins/ directory
    "/home/kirottu/Projects/anyrun/target/debug/libsymbols.so", // Absolute paths are well, asbolute and loaded as is. Useful for development.
  ],
)

Styling

Anyrun supports GTK+ CSS styling. The names for the different widgets and widgets associated with them are as follows:

  • entry: The entry box
    • GtkEntry
  • window: The window
    • GtkWindow
  • main: "Main" parts of the layout
    • GtkListBox: The main list containing the plugins
    • GtkBox: The box combining the main list and the entry box
  • plugin: Anything for the entire plugin
    • GtkLabel: The name of the plugin
    • GtkBox: The different boxes in the plugin view
    • GtkImage: The icon of the plugin
  • match: Widgets of a specific match
    • GtkBox: The main box of the match and the box containing the title and the description if present
    • GtkImage: The icon of the match (if present)
  • match-title: Specific for the title of the match
    • GtkLabel
  • match-desc: Specific for the description of the match
    • GtkLabel

Arguments

The custom arguments for anyrun are as follows:

  • --config-dir, -c: Override the configuration directory
  • --override-plugins, -o: Override the plugins to be used, provided in the same way as in the config file.

Plugin development

The plugin API is intentionally very simple to use. This is all you need for a plugin:

Cargo.toml:

#[package] omitted
[lib]
crate-type = ["cdylib"] # Required to build a dynamic library that can be loaded by anyrun

[dependencies]
anyrun-plugin = { git = "https://github.com/Kirottu/anyrun" }
abi_stable = "0.11.1"
# Any other dependencies you may have

lib.rs:

use abi_stable::std_types::{RString, RVec, ROption};
use anyrun_plugin::{plugin, PluginInfo, Match, HandleResult};

fn init(config_dir: RString) {
  // Your initialization code. This is run in another thread.
  // The return type is the data you want to share between functions
}

fn info() -> PluginInfo {
  PluginInfo {
    name: "Demo".into(),
    icon: "help-about".into(), // Icon from the icon theme
  }
}

fn get_matches(input: RString, data: &mut ()) -> RVec<Match> {
  // The logic to get matches from the input text in the `input` argument.
  // The `data` is a mutable reference to the shared data type later specified. 
  vec![Match {
    title: "Test match".into(),
    icon: ROption::RSome("help-about"),
    description: ROption::RSome("Test match for the plugin API demo"),
    id: ROption::RNone, // The ID can be used for identifying the match later, is not required
  }].into()
}

fn handler(selection: Match, data: &mut ()) -> HandleResult {
  // Handle the selected match and return how anyrun should proceed
  HandleResult::Close
}

// The type of the data we want to store is the last one, we don't need it in this one so it can be the unit type.
plugin!(init, info, get_matches, handler, ());

And that's it! That's all of the API needed to make runners. Refer to the plugins in the plugins folder for more examples.

You might also like...
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!

uwuifyy A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text! Logo Credits: Jade Nelson Tab

A customizable MCTS planner with advanced featured tailored to multi-agent simulations and emergent narratives.
A customizable MCTS planner with advanced featured tailored to multi-agent simulations and emergent narratives.

NPC engine Core:  Utils:  © 2020-2022 ETH Zurich and other contributors. See AUTHORS.txt for more details. A customizable Monte Carlo Tree Search (MCT

⚡️Highly efficient data and string formatting library for Rust.

⚡️Highly efficient data and string formatting library for Rust. 🔎 Overview Pad and format string slices and generic vectors efficiently with minimal

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Shared memory - A Rust wrapper around native shared memory for Linux and Windows

shared_memory A crate that allows you to share memory between processes. This crate provides lightweight wrappers around shared memory APIs in an OS a

A native screenshot tool for wlroots based compositors such as sway and river written in Rust
A native screenshot tool for wlroots based compositors such as sway and river written in Rust

A native screenshot tool for wlroots based compositors such as sway and river written in Rust. X11 support coming soon.

Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.
Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.

Cucumber testing framework for Rust An implementation of the Cucumber testing framework for Rust. Fully native, no external test runners or dependenci

Cloud Native Buildpack that builds an OCI image with Ollama and a large language model.
Cloud Native Buildpack that builds an OCI image with Ollama and a large language model.

Ollama Cloud Native Buildpack This buildpack builds an OCI image with Ollama and a large language model. Configure your model by an Ollama Modelfile o

Easily customizable command runner made with Rust 🦀
Easily customizable command runner made with Rust 🦀

Easily customizable command runner made with Rust 🦀 📦 Usage Install by the following command: cargo install rxe Or build from the source. git clone

A highly extensible runner that can execute any workflow.

Astro run Astro Run is a highly extensible runner that can execute any workflow. Features Workflow runtime for Docker Support for gRPC server to coord

A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️
A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️

git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers. The changelog template can be customized with a configuration file to match the desired format.

Engine / framework for creating highly customizable and user modable action RPG's

Rust RPG Toolkit PLEASE NOTE: this in early and very heavy development. API is subject to constant change, as it has newly transitioned from being a g

A highly customizable snake clone made in Rust with the Bevy engine, named after the Japanese word for snake, 蛇.
A highly customizable snake clone made in Rust with the Bevy engine, named after the Japanese word for snake, 蛇.

Hebi 🐍 A highly customizable snake clone made in Rust with the Bevy engine, named after the Japanese word for snake, 蛇(へび). Configuration One of the

Highly customizable finder with high performance. Written in Rust and uses GTK
Highly customizable finder with high performance. Written in Rust and uses GTK

Findex Highly customizable finder with high performance. Written in Rust and uses GTK Installation Automatic Binary Clone from https://aur.archlinux.o

A highly customizable, full scale web backend for web-rwkv, built on axum with websocket protocol.

web-rwkv-axum A axum web backend for web-rwkv, built on websocket. Supports BNF-constrained grammar, CFG sampling, etc., all streamed over network. St

Highly customizable splash screen library for Bevy games.

bevy_intro_screen This is a versatile Bevy library designed to create engaging and customizable introductory screens for your game. Initially conceive

rust-native-tls — Bindings for native TLS libraries

rust-native-tls Documentation An abstraction over platform-specific TLS implementations. Specifically, this crate uses SChannel on Windows (via the sc

weggli-native a "native" C API for Google's weggli

weggli-native a "native" C API for Google's weggli

TMM is a Linux native game modding tool. it allows to install and depoly mods for Linux native and wine games.

Tux Mod Manager TMM is a Linux native mod manager made with the Tauri toolkit. It can install, load, remove and deploy mods for both Linux native and

Owner
A *blazingly fast* rust developer.
null
A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering

wl-gammarelay-rs Like wl-gammarelay, but written in rust, runs on a single thread, has three times less SLOC and uses DBus (for simplicity). Dbus inte

Max Verevkin 33 Nov 23, 2022
A launcher/menu program written in Rust for wlroots-based Wayland compositors

tehda tehda (ᴛᴀʏ-dah /ˈteɪ̯.dæ/ or /teh.da/; Finnish for "to do, perform, execute") is a launcher/menu program, like dmenu, rofi, or wofi, written in

Nadia 4 Jan 29, 2023
comfy is a flexible command script manager / runner written in Rust

comfy is a cross-platform command script manager / runner tool, which allows you to run commands in the command line itself, but being these predefined in a portable and universal .comfy file.

daCoUSB 17 Nov 12, 2021
Shellcode Runner/Injector in Rust using NTDLL functions directly with the ntapi Library

RustSCRunner Shellcode Runner/Injector in Rust using NTDLL functions directly with the ntapi Library. Surprisingly this is my first ever Rust project

null 86 Dec 18, 2021
A standalone Luau script runner 🌙

Lune ?? A standalone Luau script runner ?? Use the ergonomics and readability of Luau for your shell scripts ?? ⚙️ Installation The preferred way of i

Filip Tibell 13 Feb 2, 2023
ABQ is a universal test runner that runs test suites in parallel. It’s the best tool for splitting test suites into parallel jobs locally or on CI

?? abq.build   ?? @rwx_research   ?? discord   ?? documentation ABQ is a universal test runner that runs test suites in parallel. It’s the best tool f

RWX 13 Apr 7, 2023
A small, interactive command runner

Dotree is a small interactive command runner. It wants to be a better home for your aliases and bash functions, especially those that you don't use th

Felix G. Knorr 113 Nov 14, 2023
Minimal, blazing fast Node.js script runner

nrr Minimal, blazing fast Node.js script runner. Why? nrr initializes and resolves scripts way faster than package managers. It achieves this by provi

Ryan Cao 3 Nov 17, 2023
A cross-platform graphical process/system monitor with a customizable interface and a multitude of features

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features. Supports Linux, macOS, and Windows. Inspired by both gtop and gotop.

Clement Tsang 5.8k Jan 8, 2023
☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell

☄??️ The minimal, blazing-fast, and infinitely customizable prompt for any shell

Starship Command 31.6k Dec 30, 2022