A Wayland-native runner, similar to KRunner, built with extreme customizability in mind. This fork includes additional plugins and features such as mouse scroll support.
I tested it in Kde plasma.
Note
If you use Nvidia and Anyrun refuses to close, you need to set GSK_RENDERER=ngl.
Run it as: GSK_RENDERER=ngl anyrun. This is a known issue dependent on driver versions.
anyrun daemon &
anyrun
Anyrun mainly depends various GTK4 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:
gtk4-layer-shell (libgtk4-layer-shell)
gtk4 (libgtk-4 libgdk-4)
pango (libpango-1.0)
cairo (libcairo libcairo-gobject)
gdk-pixbuf2 (libgdk_pixbuf-2.0)
glib2 (libgobject-2.0 libgio-2.0 libglib-2.0)
Note
Since 25.12.0, Anyrun also depends on anyrun-provider to provide search results. Make sure it is installed as well for Anyrun to function. If you don't want to install it into your $PATH, you can set the path to it via the provider config option.
- Scroll when full: When the number of matches exceeds the window height or the
maxEntrieslimit, you can effortlessly scroll through the list using your mouse or touchpad. (Temp: i fixed max_height is half of height screen) - GTK4 Integration: The scrolling behavior is native to GTK4, ensuring smooth performance and support for kinetic scrolling.
- Style Customizability: Full control via GTK4 CSS.
- Mouse Scroll Support: Navigate through result entries using the mouse wheel.
- Extensible Plugin System: If it can handle input and selection, Anyrun can run it.
- Easy Development: Create custom plugins with just 4 functions using the
anyrun-plugincrate. - Responsive: Asynchronous execution of plugin functions ensures the UI never hangs.
- Wayland Native: Uses GTK4 layer shell for overlays and data-control for clipboard management.
Make sure all of the dependencies are installed, and then run the following commands in order:
# Clone the repository and move to the cloned location
git clone https://github.com/mintori09/anyrun-fork && cd anyrun-fork
# Build all packages, and install the Anyrun binary
cargo build --release
cargo install --path anyrun/
# Create the config directory and the plugins subdirectory
mkdir -p ~/.config/anyrun/plugins
# Copy all of the built plugins to the correct directory
cp target/release/*.so ~/.config/anyrun/plugins
sudo cp target/release/anyrun /usr/bin/anyrun
# Copy the default config file
cp examples/config.ron ~/.config/anyrun/config.ron
cp examples/style.css ~/.config/anyrun/style.cssThe preferred way to use Home-Manager with Anyrun is by using the upstream module.
You may use it in your system like this:
{
programs.anyrun = {
enable = true;
config = {
x = { fraction = 0.5; };
y = { fraction = 0.3; };
width = { fraction = 0.3; };
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = false;
closeOnClick = false;
showResultsImmediately = false;
maxEntries = null;
plugins = [
"${pkgs.anyrun}/lib/libapplications.so"
"${pkgs.anyrun}/lib/libsymbols.so"
];
};
# Inline comments are supported for language injection into
# multi-line strings with Treesitter! (Depends on your editor)
extraCss = /*css */ ''
.some_class {
background: red;
}
'';
extraConfigFiles."some-plugin.ron".text = ''
Config(
// for any other plugin
// this file will be put in ~/.config/anyrun/some-plugin.ron
// refer to docs of xdg.configFile for available options
)
'';
};
}Alternatively, you may use the module from this repository's flake to keep up with development branches:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager";
anyrun.url = "github:anyrun-org/anyrun";
};
outputs = {self, ...}@inputs: {
homeConfigurations.user = inputs.home-manager.lib.homeManagerConfiguration {
modules = [
({ modulesPath, ... }: {
# Important! We disable home-manager's module to avoid option
# definition collisions
disabledModules = ["${modulesPath}/programs/anyrun.nix"];
})
inputs.anyrun.homeManagerModules.default
{
programs.anyrun = {
# ...
};
}
];
};
}
}Anyrun packages are built and cached automatically. To avoid unnecessary recompilations, you may use the binary cache.
nix.settings = {
builders-use-substitutes = true;
extra-substituters = [
"https://anyrun.cachix.org"
];
extra-trusted-public-keys = [
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
];
};Warning
While using the Anyrun flake, overriding the nixpkgs input for Anyrun will
cause cache misses, i.e., you will have to build from source every time. To use
the cache, do not override the Nixpkgs input.
This fork includes several specialized plugins to enhance your workflow. Add the .so files to your config.ron to enable them.
- Applications (
applications.so): Enhanced search and execution for desktop entries. - Calc (
calc.so): A fast, lightweight calculator for mathematical expressions. - Findfiles (
findfiles.so): Efficient file searching within your home directory or specified paths. - Shell Wrapper (
shell_wrapper.so): An improved wrapper for executing shell commands with better feedback. - Universal Action (
universal_action.so): Context-aware actions for various types of input and files. - Websearch (
websearch.so): Search the web using engines like Google, DuckDuckGo, and Bing. - Zoxide (
zoxide.so): Quick directory jumping powered by Zoxide.
- Symbols
libsymbols.so- Search unicode symbols.
- Rink
librink.so- Calculator & unit conversion.
- Shell
libshell.so- Run shell commands.
- Translate
libtranslate.so- Quickly translate text.
- Kidex
libkidex.so- File search provided by Kidex.
- Randr
librandr.so- Rotate and resize; quickly change monitor configurations on the fly.
- TODO: Only supports Hyprland, needs support for other compositors.
- Stdin
libstdin.so- Turn Anyrun into a dmenu-like fuzzy selector.
- Should generally be used exclusively with the
--pluginsargument.
- Dictionary
libdictionary.so- Look up definitions for words
- Websearch
libwebsearch.so- Search the web with configurable engines: Google, Ecosia, Bing, DuckDuckGo.
- Nix-run
libnix_run.sonix rungraphical applications straight from Anyrun.
- niri-focus
libniri_focus.so- Focus active windows with fuzzy search on niri.
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 default config file contains the default values, and annotates all configuration options with comments on what they are and how to use them.
Anyrun supports GTK4 CSS styling. The style classes and widgets that use them are as follows:
- No class, unique widget:
GtkText: The main entry boxGtkWindow: The main window
.main:GtkBox: The box that contains everything else
.matches:GtkBox: The box that contains all the results & info boxes
.plugin:GtkBox: The main plugin box.info:GtkBox: Box containing the plugin infoGtkImage: Icon of the pluginGtkLabel: Name of the plugin
.match:GtkBox: The box containing all contents of a matchGtkImage: The icon (if present).title:GtkLabel: The title
.descriptionGtkLabel: The description (if present)
Refer to the default style for an example, and use GTK_DEBUG=interactive anyrun
to edit styles live.
The custom arguments for anyrun are as follows:
--config-dir,-c: Override the configuration directory
The rest of the arguments are automatically generated based on the config, and
can be used to override configuration parameters. For example if you want to
temporarily only run the Applications and Symbols plugins on the top side of the
screen, you would run
anyrun --plugins libapplications.so --plugins libsymbols.so --position top.
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/anyrun-org/anyrun" }
abi_stable = "0.11.1"
# Any other dependencies you may havelib.rs:
use abi_stable::std_types::{RString, RVec, ROption};
use anyrun_plugin::*;
#[init]
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
}
#[info]
fn info() -> PluginInfo {
PluginInfo {
name: "Demo".into(),
icon: "help-about".into(), // Icon from the icon theme
}
}
#[get_matches]
fn get_matches(input: RString) -> 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".into()),
use_pango: false,
description: ROption::RSome("Test match for the plugin API demo".into()),
id: ROption::RNone, // The ID can be used for identifying the match later, is not required
}].into()
}
#[handler]
fn handler(selection: Match) -> HandleResult {
// Handle the selected match and return how anyrun should proceed
HandleResult::Close
}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.
