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.

fztop 629B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. while :; do
  3. case "$1" in
  4. -h|--help)
  5. LESS=-FEXR less <<HELP
  6. fztop SEARCH
  7. USAGE:
  8. at runtime a the following keybinds are available:
  9. ctrl-x
  10. will send SIGTERM to the selected process
  11. F9
  12. will send SIGKILL to the selected process
  13. HELP
  14. exit ;;
  15. *) break
  16. esac
  17. done
  18. exec fzf \
  19. --reverse \
  20. --header-lines=1 \
  21. --query="!fzf $*" \
  22. --preview='echo {}' \
  23. --preview-window=down:4:wrap \
  24. --bind='change:reload:ps xjf' \
  25. --bind='ctrl-r:reload:ps xjf' \
  26. --bind='ctrl-x:execute(kill {2})+reload(ps xjf)' \
  27. --bind='F9:execute:(kill -9 {2})+reload(ps xjf)' < <(ps xjf)