]> git.sev.monster Git - dotfiles.git/commitdiff
remove check-busybox, integrate into zshrc
authorsev <git@sev.monster>
Fri, 23 Aug 2024 21:05:41 +0000 (16:05 -0500)
committersev <git@sev.monster>
Fri, 23 Aug 2024 21:12:12 +0000 (16:12 -0500)
bin/.check-busybox [deleted file]
etc/zsh/.zshrc

diff --git a/bin/.check-busybox b/bin/.check-busybox
deleted file mode 100644 (file)
index 48abb8d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-function check-busybox() {
-    command -v "$1" >/dev/null 2>&1 && [ "busybox" = "$(basename "$(readlink -f "$(command -v "$1")")")" ]
-}
index da694128d5a71b2be531ff9f13417f77d5b3dff8..21b596486e6cf9db588a3f34fb8ce7ce2effd97a 100644 (file)
@@ -242,25 +242,23 @@ if [[ "$OSTYPE" =~ '^freebsd' ]] {
 }
 [[ -v commands[trash-put] ]] && alias t=trash-put
 # ps
 }
 [[ -v commands[trash-put] ]] && alias t=trash-put
 # ps
-source ~/.local/bin/.check-busybox
-if [[ -v commands[pstree] ]] && ! check-busybox pstree; then
+if [[ -v commands[pstree] && $commands[pstree]:A:t != busybox ]] {
     # use pstree, but NOT busybox pstree because it kinda sucks
     ps="pstree -wg3"
     # use pstree, but NOT busybox pstree because it kinda sucks
     ps="pstree -wg3"
-elif [[ "$OSTYPE" =~ '^freebsd' ]]; then
+} elif [[ "$OSTYPE" =~ '^freebsd' ]] {
     ps="ps -aSdfxwwouser=USR -ogroup=GRP -opid,nice=NI \
        -o%cpu,%mem,tty,stat,start=START -oetime,command"
     ps="ps -aSdfxwwouser=USR -ogroup=GRP -opid,nice=NI \
        -o%cpu,%mem,tty,stat,start=START -oetime,command"
-elif check-busybox ps; then
+} elif [[ $commands[ps]:A:t == busybox ]] {
     # busybox compatible
     ps="ps -eouser='USR     ' -ogroup='GRP     ' \
        -opid='  PID' -onice=' NI' -ovsz=' MEM' \
        -otty,stat,etime,comm"
     # busybox compatible
     ps="ps -eouser='USR     ' -ogroup='GRP     ' \
        -opid='  PID' -onice=' NI' -ovsz=' MEM' \
        -otty,stat,etime,comm"
-else
+} else {
     # XXX: untested, posix
     # TODO: support gnu ps
     ps="ps -eouser=USR -ogroup=GRP -opid,nice=NI \
        -opcpu=CPU -ovsz=MEM -otty,stat,etime,comm"
     # XXX: untested, posix
     # TODO: support gnu ps
     ps="ps -eouser=USR -ogroup=GRP -opid,nice=NI \
        -opcpu=CPU -ovsz=MEM -otty,stat,etime,comm"
-fi
-unfunction check-busybox
+}
 if [[ "$(basename "$PAGER")" = "less" ]] {
     ps="$ps | less -S"
 } else {
 if [[ "$(basename "$PAGER")" = "less" ]] {
     ps="$ps | less -S"
 } else {
This page took 0.036896 seconds and 4 git commands to generate.