dmenu-sysmon.sh 849 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. # ____ _____
  4. # | _ \_ _| Derek Taylor (DistroTube)
  5. # | | | || | http://www.youtube.com/c/DistroTube
  6. # | |_| || | http://www.gitlab.com/dwt1/
  7. # |____/ |_|
  8. #
  9. # Dmenu script for launching system monitoring programs.
  10. declare -a options=("bashtop
  11. glances
  12. gtop
  13. htop
  14. iftop
  15. iotop
  16. iptraf-ng
  17. nmon
  18. s-tui
  19. quit")
  20. choice=$(echo -e "${options[@]}" | dmenu -l -i -p 'System monitors: ')
  21. case $choice in
  22. quit)
  23. echo "Program terminated." && exit 1
  24. ;;
  25. bashtop| \
  26. glances| \
  27. gtop| \
  28. htop| \
  29. nmon| \
  30. s-tui)
  31. exec st -e $choice
  32. ;;
  33. iftop| \
  34. iotop| \
  35. iptraf-ng)
  36. exec st -e gksu $choice
  37. ;;
  38. *)
  39. exit 1
  40. ;;
  41. esac