mirror of
https://github.com/CoolnsX/hyprdots.git
synced 2026-06-17 07:42:07 +05:30
Somebody set up us the bomb.
This commit is contained in:
@@ -315,4 +315,36 @@ vpn() {
|
||||
doas systemctl $query openvpn-client@vpn.service && printf "Openvpn %sed" "$query"
|
||||
}
|
||||
|
||||
|
||||
command_not_found_handler() {
|
||||
local purple='\e[1;35m' bright='\e[0;1m' green='\e[1;32m' reset='\e[0m'
|
||||
printf 'zsh: command not found: %s\n' "$1"
|
||||
local entries=(
|
||||
${(f)"$(/usr/bin/pacman -F --machinereadable -- "/usr/bin/$1")"}
|
||||
)
|
||||
if (( ${#entries[@]} ))
|
||||
then
|
||||
printf "${bright}$1${reset} may be found in the following packages:\n"
|
||||
local pkg
|
||||
for entry in "${entries[@]}"
|
||||
do
|
||||
# (repo package version file)
|
||||
local fields=(
|
||||
${(0)entry}
|
||||
)
|
||||
if [[ "$pkg" != "${fields[2]}" ]]
|
||||
then
|
||||
printf "${purple}%s/${bright}%s ${green}%s${reset}\n" "${fields[1]}" "${fields[2]}" "${fields[3]}"
|
||||
fi
|
||||
printf ' /%s\n' "${fields[4]}"
|
||||
pkg="${fields[2]}"
|
||||
done
|
||||
fi
|
||||
return 127
|
||||
}
|
||||
|
||||
gen_string() {
|
||||
head /dev/urandom | tr -cd "${2:-[:alnum:]}" | cut -c-${1:-12}
|
||||
}
|
||||
|
||||
# vim: ft=zsh
|
||||
|
||||
Reference in New Issue
Block a user