mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
22 lines
618 B
Bash
Executable File
22 lines
618 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# fzfmenu - fzf as dmenu replacement
|
|
# https://github.com/junegunn/fzf/wiki/Examples#fzf-as-dmenu-replacement
|
|
set -efu
|
|
|
|
input=$(mktemp -u --suffix .fzfmenu.input)
|
|
output=$(mktemp -u --suffix .fzfmenu.output)
|
|
mkfifo "$input"
|
|
mkfifo "$output"
|
|
chmod 600 "$input" "$output"
|
|
|
|
# it's better to use st here (starts a lot faster than pretty much everything else)
|
|
st -c fzfmenu -n fzfmenu -g 85x10 \
|
|
-e dash \
|
|
-c "cat $input | fzf --print-query $* | tee $output" & disown
|
|
|
|
# handle ctrl+c outside child terminal window
|
|
trap 'kill $! 2>/dev/null; rm -f $input $output' EXIT
|
|
|
|
cat > "$input"
|
|
cat "$output"
|