My build of nnn with minor changes
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

4 лет назад
4 лет назад
4 лет назад
4 лет назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env sh
  2. # Description: Independent POSIX-compliant GUI application launcher.
  3. # Fuzzy find executables in $PATH and launch an application.
  4. # stdin, stdout, stderr are suppressed so CLI tools exit silently.
  5. #
  6. # To configure launch as an independent app launcher add a keybind
  7. # to open launch in a terminal e.g.,
  8. #
  9. # xfce4-terminal -e "${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/launch
  10. #
  11. # Requires: fzf/fzy
  12. #
  13. # Usage: launch [delay]
  14. # delay is in seconds, if omitted launch waits for 1 sec
  15. #
  16. # Integration with nnn: launch is installed with other plugins, nnn picks it up.
  17. #
  18. # Shell: POSIX compliant
  19. # Author: Arun Prakash Jana
  20. # shellcheck disable=SC2086
  21. IFS=':'
  22. get_selection() {
  23. if which fzf >/dev/null 2>&1; then
  24. { IFS=':'; ls -H $PATH; } | sort | fzf
  25. elif which fzy >/dev/null 2>&1; then
  26. { IFS=':'; ls -H $PATH; } | sort | fzy
  27. else
  28. exit 1
  29. fi
  30. }
  31. if selection=$( get_selection ); then
  32. setsid "$selection" 2>/dev/null 1>/dev/null &
  33. if ! [ -z "$1" ]; then
  34. sleep "$1"
  35. else
  36. sleep 1
  37. fi
  38. fi