nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit db240eeeda896e9db3c421d20ab28c6d8540a387
parent 7bbacd0f0d20c11cc64c1bdecb0c4313ef06a12f
Author: PiƱa Colada <engineerarun@gmail.com>
Date:   Sun, 16 May 2021 02:02:28 +0530

Merge pull request #1011 from luukvbaal/cmusq

Wait until cmus is ready and fix fzplug preview command
Diffstat:
Mplugins/cmusq | 2+-
Mplugins/fzplug | 18++++++------------
2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/plugins/cmusq b/plugins/cmusq @@ -40,7 +40,7 @@ start_cmus() { nohup "$TERMINAL" -e cmus & ;; esac # Give the new terminal some time to open - until pidof cmus >/dev/null; do sleep 0.1; done + until cmus-remote -C; do sleep 0.1; done [ -n "$nnnwindow" ] && xdotool windowactivate "$nnnwindow" } >/dev/null 2>&1 diff --git a/plugins/fzplug b/plugins/fzplug @@ -31,20 +31,14 @@ nnnpluginsdir="$HOME/.config/nnn/plugins" # Preview with bat if installed if type bat >/dev/null; then - plugin=$(find "$nnnpluginsdir" "$CUSTOMDIR1" "$CUSTOMDIR2" \ - -maxdepth 3 -perm -111 -type f 2>/dev/null | fzf --ansi --preview \ - "cat {}" \ - --preview-window right:66%:wrap --delimiter / --with-nth -1 \ - --bind="?:toggle-preview") -else - plugin=$(find "$nnnpluginsdir" "$CUSTOMDIR1" "$CUSTOMDIR2" \ - -maxdepth 3 -perm -111 -type f 2>/dev/null | fzf --ansi --preview \ - "bat --terminal-width='$(tput cols)' --decorations=always --color=always \ - --style='${BAT_STYLE:-header,numbers}' {}" \ - --preview-window right:66% --delimiter / --with-nth -1 \ - --bind="?:toggle-preview") + BAT="bat --terminal-width='$(tput cols)' --decorations=always --color=always --style='${BAT_STYLE:-header,numbers}'" fi +plugin=$(find "$nnnpluginsdir" "$CUSTOMDIR1" "$CUSTOMDIR2" \ +-maxdepth 3 -perm -111 -type f 2>/dev/null | fzf --ansi --preview \ + "${BAT:-cat} {}" --preview-window="right:66%:wrap" --delimiter / \ + --with-nth -1 --bind="?:toggle-preview") + # Try running the script on the hovered file, and abort # abort if no plugin was selected (ESC or ^C pressed). err=0