Skip to content

Commit 452b3ec

Browse files
authored
Merge pull request #84 from pdonadeo/master
Make fzf preview window configurable
2 parents 109b356 + 41025f6 commit 452b3ec

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ Some of your desktop entries will probably be TUI programs that expect to be lau
5757
### Configure application autostart
5858
If you want to be able to autostart applications , this script provides a function to handle them for you. Simply run `sway-launcher-desktop.sh autostart` in your `.bashrc`, at the end of your i3/sway config, or wherever else you deem fit.
5959

60+
### Configure fzf preview window
61+
You can configure the fzf preview window using the environment variable `PREVIEW_WINDOW` (default: `up:2:noborder`). For example, if you prefer a taller window, you could use `PREVIEW_WINDOW=5:up`. The content of `PREVIEW_WINDOW` is passed to the `--preview-window` option, so check out the fzf manual for further details.
62+
6063
## Extending the launcher
6164

6265
In addition to desktop application entries and binaries, you can extend `sway-launcher-desktop` with custom item providers.

sway-launcher-desktop.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if [[ "${PROVIDERS_FILE#/}" == "${PROVIDERS_FILE}" ]]; then
2222
# $PROVIDERS_FILE is a relative path, prepend $CONFIG_DIR
2323
PROVIDERS_FILE="${CONFIG_DIR}/${PROVIDERS_FILE}"
2424
fi
25+
if [[ ! -v PREVIEW_WINDOW ]]; then
26+
PREVIEW_WINDOW=up:2:noborder
27+
fi
2528

2629
# Provider config entries are separated by the field separator \034 and have the following structure:
2730
# list_cmd,preview_cmd,launch_cmd,purge_cmd
@@ -316,7 +319,7 @@ readarray -t COMMAND_STR <<<$(
316319
${FZF_COMMAND} --ansi +s -x -d '\034' --nth ..3 --with-nth 3 \
317320
--print-query \
318321
--preview "$0 describe {2} {1}" \
319-
--preview-window=up:2:noborder \
322+
--preview-window="${PREVIEW_WINDOW}" \
320323
--no-multi --cycle \
321324
--prompt="${GLYPH_PROMPT-# }" \
322325
--header='' --no-info --margin='1,2' \

0 commit comments

Comments
 (0)