+### imports
+source ~/bin/.check-busybox
+
### user-local fpath
fpath=(~/.zsh ~/.zsh/functions/Prompts "${fpath[@]}")
}
## 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' \
## sound
# TODO: test alsa/oss/sndio/portaudio/pulse in order of importance
function s() {}
+ function vol() {}
esac
### modules & styles
autoload -Uz promptinit && promptinit
prompt ds6
+
+### unset imports
+unfunction check-busybox
+
# vim: set et sts=4 sw=4 ts=8 tw=79 :
#!/bin/sh
+. ~/bin/.check-busybox
p="$1"
-if [ -z "$p" -a "$(basename "$(readlink -f "$(which ps)")")" =~ "/busybox" ]; then
+if [ -z "$p" ] && ! check-busybox ps; then
p="[$(ps -o comm= -p $(ps -o ppid= -p $$))]";
fi
~/bin/dmenu -p "$p" -fn Dina-10 -nb \#110800 -nf \#110800 -sb \#264bd2 -sf \#fdf6e3 <&-
+unset check-busybox
xrandr --output $output --rotation $rot1
# x220t
-if which xsetwacom >/dev/null; then
+if which xsetwacom >/dev/null 2>&1; then
xsetwacom --set stylus Rotate $rot2
xsetwacom --set eraser Rotate $rot2
xsetwacom --set touch Rotate $rot2
#!/bin/sh
+. ~/bin/.check-busybox
u=-u
-if readlink -f $(which sed) | grep -q /busybox; then u=''; fi
+check-busybox sed && u=''
i3status -c ${XDG_CONFIG_HOME:-~/.config}/i3status/tint2-$1 | sed $u -e 's/fc=\(#[a-f0-9]\{3,6\}\)/span color="\1"/gi;s_/fc_/span_g'
+unset check-busybox