Skip to content

Commit

Permalink
Merge pull request #83 from pmodin/master
Browse files Browse the repository at this point in the history
Make fzf path configurable
  • Loading branch information
Biont authored Jun 10, 2024
2 parents c8afcb8 + 7c61df2 commit 109b356
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ You can override the default icons/glyphs by setting the appropriate GLYPH_ vari
set $menu exec $term -e env GLYPH_COMMAND="" GLYPH_DESKTOP="" GLYPH_PROMPT="? " sway-launcher
```

If `fzf` is not in your `$PATH` you can specify the path by supplying a value to the `FZF_COMMAND` variable.
```
set $menu exec $term -e env FZF_COMMAND="/path/to/fzf" sway-launcher
```

By default, the launcher will use a generic & WM-agnostic command to launch the selected program.
However, it will detect if its output is being piped to another program and merely print
the selected command in that case - instead of launching it by itself. You can use this to integrate the launcher with other tools.
Expand Down
3 changes: 2 additions & 1 deletion sway-launcher-desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
IFS=$'\n\t'
DEL=$'\34'

FZF_COMMAND="${FZF_COMMAND:=fzf}"
TERMINAL_COMMAND="${TERMINAL_COMMAND:="$TERMINAL -e"}"
GLYPH_COMMAND="${GLYPH_COMMAND- }"
GLYPH_DESKTOP="${GLYPH_DESKTOP- }"
Expand Down Expand Up @@ -312,7 +313,7 @@ for PROVIDER_NAME in "${!PROVIDERS[@]}"; do
done

readarray -t COMMAND_STR <<<$(
fzf --ansi +s -x -d '\034' --nth ..3 --with-nth 3 \
${FZF_COMMAND} --ansi +s -x -d '\034' --nth ..3 --with-nth 3 \
--print-query \
--preview "$0 describe {2} {1}" \
--preview-window=up:2:noborder \
Expand Down

0 comments on commit 109b356

Please sign in to comment.