Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.
/ find-the-command Public archive

Interactive command-not-found hook for bash and zsh, that uses pacman as a backend (BTW, this shit should be completely re-written as it's very ugly)

License

Notifications You must be signed in to change notification settings

agura-lex/find-the-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Find the command

Find-the-command is a bunch of simple command-not-found hooks, intended for using with pacman, it is primarily targeting Arch-based distros. It uses pacman functionality for searching files, introduced in 5.0 release, so there are no useless pkgfile dependencies.

How does it work?

Interactive shells have an ability to run a specified function when entered command is not found. So these hooks contain a simple function, which is run when shell fails to find any local executables in PATH, aliases and functions matching entered command. There are both interactive hooks, which are providing installation prompt and some other useful functionality (like showing info about package), and 'non-interactive', which are only displaying a package (or list of packages) that provides needed command.

Installation

$ git clone https://aur.archlinux.org/find-the-command.git
$ cd find-the-command
$ makepkg -si

Alternatively, you can use yay:

$ yay -S find-the-command

To enable it, you need to source needed file from /usr/share/doc/find-the-command directory according to the shell you use. For example, to enable find-the-command zsh hook, you need to place the following in your ~/.zshrc:

source /usr/share/doc/find-the-command/ftc.zsh

You can also append some options when sourcing file to customize your experience.

Option Description Bash Zsh Fish
noprompt Disable installation prompt.
quiet Decrese verbosity.
su Always use su instead of sudo.
install Automatically install the package without prompting for action.
info Automatically print package info without prompting for action.
list_files Automatically print a list of package files without prompting for action.
list_files_paged Automatically print a paged list of package files without prompting for action.

For example:

source /usr/share/doc/find-the-command/ftc quiet su

It is also necessary to create pacman files database:

# pacman -Fy

There is also systemd timer included to update pacman files database on daily basis, so you don't need to worry about it, just run once the following:

# systemctl enable pacman-files.timer

Screenshots

Screenshot Screenshot Without prompt

About

Interactive command-not-found hook for bash and zsh, that uses pacman as a backend (BTW, this shit should be completely re-written as it's very ugly)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages