Crates.io | anyrun |
lib.rs | anyrun |
version | 0.2.1 |
created_at | 2025-06-01 03:50:41.494731+00 |
updated_at | 2025-08-30 23:08:42.670568+00 |
description | Run anything from the commandline including desktop files and flatpaks |
homepage | |
repository | https://gitlab.com/caferen/anyrun |
max_upload_size | |
id | 1696857 |
size | 8,198 |
Finds the associated desktop file for its argument and executes its Exec
line. Also accepts input from stdin.
anyrun
will loop through all desktop files in XDG_DATA_DIRS
and semi-fuzzily match the Name
line to find its target.Any other argument after the first one is passed to the launched application as is.
~/.local/share/applications
and make sure it's the first directory in XDG_DATA_DIRS
.${FLATPAK_USER_DIR}/exports/share
to XDG_DATA_DIRS
. See.anyrun
, add this to ~/.zshrc
(make sure anyrun
is in your path):intercept-exec() {
read -r cmd args <<< "${(z)BUFFER}"
if [[ -z $(command -v "$cmd") && "$cmd" != *=* ]]; then
BUFFER="anyrun $BUFFER &>/dev/null &!"
fi
zle accept-line
}
zle -N intercept-exec
bindkey '^M' intercept-exec
This'll make your shell commands run as usual but will append anyrun
to anything else. e.g. running chrm
in your
shell will launch Chromium/Chrome, even if they're flatpaks.
anyrun frfx
: Launches Firefox, even if it's a flatpak.
anyrun frfx @@ /path/to/some/file @@
: Opens the file in Firefox.
anyrun firef --new-window https://gitlab.com/caferen/anyrun
: Opens anyrun
s repository in a new Firefox window.
anyrun <<< "firef --new-window https://gitlab.com/caferen/anyrun"
: Opens anyrun
s repository in a new Firefox window but cooler.