config

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

commit 4364c1c513830d4edd72d2aff8fedff28bb72e64
parent 21ea386440121f0de84e160d9ed82e68a65a858e
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Tue,  7 Sep 2021 23:59:30 -0700

Update rc profile

- Add cdp function to go to the previous directory
- Move curl function to netget script
- Only define OpenBSD package management functions on OpenBSD
- Use appropriate casing [?] for section headings (for my region at least)

Diffstat:
Alocal/bin/bin/netget | 5+++++
Mlocal/rc/lib/profile | 50+++++++++++++++++++++++++-------------------------
2 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/local/bin/bin/netget b/local/bin/bin/netget @@ -0,0 +1,5 @@ +#!/bin/sh +# Copyright 2021 Jacob R. Edwards +# License: GPLv3 + +exec curl -SsL "$@" diff --git a/local/rc/lib/profile b/local/rc/lib/profile @@ -1,38 +1,36 @@ -# rc profile +# rc profile -# plan9[port] PLAN9 = /usr/local/plan9 font = $PLAN9/font/misc/unicode.6x13.font - -# rc path = (. $home/bin /bin /sbin /usr/^(bin sbin)\ /usr/local/^(bin sbin) $PLAN9/bin /usr/X11R6/bin) prompt = ('; ' '') -history = $home/lib/history-`{ date +%Y-%m } # Means nothing to stock rc ifs = ' ' -# programs +# History (not in standard rc) +history = $home/lib/history-`{ date +%Y-%m } + +# Program Preferences BROWSER = dillo CC = tcc EDITOR = sam -LOCKER = slock PAGER = cat SHELL = rc TERMINAL = 9term VISUAL = $EDITOR -# XDG directories +# XDG Directories XDG_CACHE_HOME = $home/local/cache/ XDG_CONFIG_HOME = $home/config/ XDG_DATA_HOME = $home/local/share/ -# make(1) +# Make MAKEFLAGS = -e MANPREFIX = /usr/local/man/ PREFIX = /usr/local/ -# cd +# Directory Changing dirlog = $XDG_DATA_HOME/cd fn cd { @@ -44,31 +42,33 @@ fn cd { status = '' } } - fn cdl { uniq <$dirlog | stest -d } fn cdr { cd `{ cdl | egrep $* | tail -1 } } fn cds { cd `{ pwd | sed s.$1.$2.g } } +fn cdp { cd `{ cdl | fgrep -vx `{ pwd } | tail -1 } } -# history search +# History Search fn hs { grep $* $history } -# OpenBSD package management -fn pa { doas pkg_add $* } -fn pd { doas pkg_delete $* } -fn pdd { doas rc -c 'pd $* && pd -a' $* } -fn pdp { pkg_depend $* } -fn pi { pkg_info -q $* } -fn plc { pkg_locate $* } -fn pr { pkgroot $* } -fn pt { pkgtree $* } +# OpenBSD Package Management +if (test `{ uname } = 'OpenBSD') { + fn pa { doas pkg_add $* } + fn pd { doas pkg_delete $* } + fn pdd { doas rc -c 'pd $* && pd -a' $* } + fn pdp { pkg_depend $* } + fn pi { pkg_info -q $* } + fn plc { pkg_locate $* } + fn pr { pkgroot $* } + fn pt { pkgtree $* } +} -# simple -fn curl { builtin curl -SsL $* } -fn dsu { doas su $* } +# List Functions fn fns { whatis `{ printenv | awk -F '[#=]' '/^fn#/ { print $2 }' } } + +# Simple fn ls { 9 ls $* } -# short +# Short and Simple fn c { builtin $* } fn d { doas $* } fn e { egrep $* }