You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
629 B

2 years ago
#!/usr/bin/env bash
while :; do
case "$1" in
-h|--help)
LESS=-FEXR less <<HELP
fztop SEARCH
USAGE:
at runtime a the following keybinds are available:
ctrl-x
will send SIGTERM to the selected process
F9
will send SIGKILL to the selected process
HELP
exit ;;
*) break
esac
done
exec fzf \
--reverse \
--header-lines=1 \
--query="!fzf $*" \
--preview='echo {}' \
--preview-window=down:4:wrap \
--bind='change:reload:ps xjf' \
--bind='ctrl-r:reload:ps xjf' \
2 years ago
--bind='ctrl-x:execute(kill {2})+reload(ps xjf)' \
--bind='F9:execute:(kill -9 {2})+reload(ps xjf)' < <(ps xjf)