1
0
Fork 0
dotfiles/common/.config/zsh/config/functions.zsh

30 lines
686 B
Bash

function clipcopy() {
cat "${1:-/dev/stdin}" | xsel --clipboard --input
}
function clippaste() {
xsel --clipboard --output
}
function xsi() {
xpkg -a | \
fzf -q ${1:-""} -m --preview \
"xq {1} | grep -e pkgver -e license -e short_desc -e installed_size -e maintainer -e repository -e homepage" \
--preview-window=right:66%:wrap | xargs -ro xi
}
function whed() {
local script
script=$(which "$1")
[ -e "$script" ] && $EDITOR $(which "$script")
}
function hosthost() {
local ip
ip=$(
host -t A "$1" | awk '{print $4}' ||
host -t AAAA "$1" | awk '{print $5}'
)
host "$ip" | awk '{print $5}' | sed 's/.$//'
}