}
add-zsh-hook chpwd sev_chpwd
-### system-specific configs and aliases
-case $OSTYPE; in
- freebsd*)
- ## colors
- export CLICOLOR=
- export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
-
- ## sound
- function s { sysctl hw.snd.default_unit${1:+\=$1} }
- alias vol mixer
-
- ## install port dependencies from pkg (like pkgsrc `bmake bin-install')
- # XXX: should probably use package-depends where possible, breaks when
- # port name is different to package name
- # (eg. graphics/sdl20 == sdl2, devel/glib20 == glib2, etc)
- function portpkg {
- case "$1" {
- build|run)
- sudo pkg install -AU $(make ${1}-depends-list |
- sed 's_/usr/ports/_ _' | tr -d '\n')
- ;;
- *) echo "Usage: \`portpkg <build|run>' in a port directory"
- return 1;;
- }
- };;
- netbsd)
- ## sound
- function s {
- if [[ -z "$1" ]] {
- ll /dev/mixer /dev/sound /dev/audio
- return
- }
- for x in mixer sound audio; do
- ln -sf /dev/$x"$1" /dev/$x
- done
- }
- function vol {
- if [[ -z "$1" ]] {
- for x in $(mixerctl -a | grep 'outputs\.master'); do
- echo -E - $x
- done
- return
- }
- mixerctl -w outputs.master"$2"="$1"
- };;
- *)
- ## sound
- # TODO: test alsa/oss/sndio/portaudio/pulse/pipewire in order of importance
- function s {}
- function vol {}
-esac
-
### prompt
autoload -Uz promptinit && promptinit
prompt arrows