config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit 5f230ee32d380d7aea46277bd32d4d59aac707f1
parent d8a2b18b7cd0659d3dea23b16003101e1436999e
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Tue, 12 Jan 2021 21:13:01 -0800

Update shell functions

Remove `doasroot' and instead put `permit nopass root as root' in
doas.conf.

Update OpenBSD package management functions, add `xV' flags to
`pkg_delete' and use the ports index for finding packages rather
than `pkg_locate(1)' which contains every file in every port.

Diffstat:
Mmodules/shell/.config/shell/main | 20++++----------------
Mmodules/shell/.config/shell/openbsd | 14++++++--------
2 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/modules/shell/.config/shell/main b/modules/shell/.config/shell/main @@ -15,21 +15,9 @@ include() { alias doas="doas -- " -# only invoke doas if uid is not 0, define before including openbsd. -doasroot() { - if test `id -u` -ne 0; then - doas $* - else - $* - fi -} - -# Must be included here for ncpu. -include openbsd - alias ap="apropos" alias apf="apropos -f" -alias dsu="doasroot su" +alias dsu="doas su" alias fls="find . -maxdepth 1" alias get="curl -sSLO" alias grep="egrep" @@ -47,6 +35,7 @@ alias f="$EDITOR" alias g="git" alias l="$PAGER" alias t="tmux" +alias d="doas" doin() { (builtin cd ${1:?No directory} && shift && eval $@) ;} dus() { du -h "$@" | sort -h ;} @@ -59,7 +48,6 @@ note() { doin $HOME/own/text/note/ $@ ;} np() { unset ALL_PROXY; unset HTTP_PROXY ;} reload() { . ~/.profile && include main ;} vol() { sndioctl output.level=$@ ;} - fp() { local bin=`which $@ 2>/dev/null` f ${bin:?No such file or directory} @@ -68,6 +56,6 @@ fp() { include cd include history include mpc -include xorg - +include openbsd include private 2>/dev/null +include xorg diff --git a/modules/shell/.config/shell/openbsd b/modules/shell/.config/shell/openbsd @@ -4,11 +4,9 @@ alias ncpu="sysctl -n hw.ncpufound" alias load="sysctl -n vm.loadavg" # package management -alias pkg_add="pkg_add -xV" - -alias pa="doasroot pkg_add" -alias pd="doasroot pkg_delete" -alias pi="pkg_info" -alias pu="doasroot pkg_add -u" - -pq() { pkglocate "*${@}*" | cut -d: -f1 | uniq ;} +pa() { doas pkg_add -xV $* ;} +pd() { doas pkg_delete -xV $* ;} +pi() { pkg_info $* ;} +pu() { doas pkg_add -u $* ;} +pq() { egrep $* /usr/local/share/ports-INDEX | cut -d'|' -f1,4 | tr '|' '\t' ;} +pQ() { pkg_locate $* ;}