]> git.sev.monster Git - dotfiles.git/blobdiff - base/.zshrc
fix which usage, create function check-busybox
[dotfiles.git] / base / .zshrc
index e06c318d6ba169aa77f41d76b5c611b4d41c203f..eec9016b9b2cb3fa1dc5bda1d0c85dba38990559 100644 (file)
@@ -1,3 +1,6 @@
+### imports
+source ~/bin/.check-busybox
+
 ### user-local fpath
 fpath=(~/.zsh ~/.zsh/functions/Prompts "${fpath[@]}")
 
@@ -53,14 +56,13 @@ if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] {
 }
 ## ps
 local p=
-if { which pstree >/dev/null 2>&1 && \
-  [[ ! "$(readlink -f $(which pstree))" =~ "/busybox" ]] } {
+if which pstree >/dev/null 2>&1 && ! check-busybox pstree {
     # use pstree, but NOT busybox pstree because it kinda sucks
     p="pstree -wg3"
 } elif [[ "$OSTYPE" =~ '^freebsd' ]] {
     p="ps -aSdfxwwouser=USR -ogroup=GRP -opid,nice=NI \
        -o%cpu,%mem,tty,stat,start=START -oetime,command"
-} elif [[ "$(readlink -f $(which ps))" =~ "/busybox" ]] {
+} elif check-busybox ps {
     # busybox compatible
     p="ps -eouser='USR     ' -ogroup='GRP     ' \
        -opid='  PID' -onice=' NI' -ovsz=' MEM' \
@@ -167,6 +169,7 @@ case "$OSTYPE"; in
         ## sound
         # TODO: test alsa/oss/sndio/portaudio/pulse in order of importance
         function s() {}
+        function vol() {}
 esac
 
 ### modules & styles
@@ -204,4 +207,8 @@ compinit
 autoload -Uz promptinit && promptinit
 prompt ds6
 
+
+### unset imports
+unfunction check-busybox
+
 # vim: set et sts=4 sw=4 ts=8 tw=79 :
This page took 0.041484 seconds and 4 git commands to generate.