Skip to content

A fast command not found handler for Pacman

License

Notifications You must be signed in to change notification settings

Alexendoo/findpkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
}

About

A fast command not found handler for Pacman

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published