Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 1.28 KB

README.md

File metadata and controls

71 lines (50 loc) · 1.28 KB

findpkg

A fast command not found handler for pacman. It suggests which package to install when you try to run a command from a package that isn't installed

$ tree
tree may be found in the following packages:
  extra/tree    /usr/bin/tree

The output is more or less the same as pkgfile's hook but is substantially faster. pkgfile can take several seconds to complete, which is easily confused for a successful command invocation

Hook Cold cache Warm cache
findpkg 40ms 1.4ms
pkgfile 1874ms 440ms

Installation

Install findpkg from the AUR

yay -S findpkg

Create/update the database

sudo pkgfile --update

Enable automatic database updates (Optional)

systemctl enable pkgfile.timer

Bash

Add the following to ~/.bashrc

command_not_found_handle() {
	findpkg "$1"
}

fish

Run:

function fish_command_not_found
    findpkg $argv[1]
end

funcsave fish_command_not_found

Zsh

Add the following to ~/.zshrc

command_not_found_handler() {
	findpkg "$1"
}