zsh/aliases/void
2020-02-13 14:51:41 +01:00

57 lines
796 B
Bash

#!/bin/zsh
grep -q "void" /etc/os-release || return
alias xq="xbps-query -Rs"
xqn() {
if [[ -z $1 || -n $2 ]]; then
<<-HERE
Usage: xqn NAME
Search for NAME only in package names
HERE
else
xbps-query -Rs $1 | awk "\$2 ~ /$1/ { print }"
fi
}
alias xfiles="xbps-query -f"
function xupdate() {
sudo xbps-install -Su
if [[ $? == 16 ]]; then
xbps-install -Syu xbps
xupdate
fi
}
function xowner() {
xbps-query -Ro "*${1}*"
}
sv() {
command sv "$@"
if [[ "$1" == "up" ]]; then
shift
sleep 0.5
command sv check "$@"
fi
}
sv-manage() {
action=$1
shift
case "$action" in
add)
for service in "$@"; do
ln -s /etc/sv/${service:s#/##} /var/service
done
;;
remove|rm)
for service in "$@"; do
rm /var/service/${service:s#/##}
done
;;
esac
}