Add a dmenu replacement script
Based on https://git.sr.ht/~seirdy/term-dmenu/
This commit is contained in:
parent
3bc0b51a1c
commit
41a041336e
1 changed files with 23 additions and 0 deletions
23
bin/dmenu
Executable file
23
bin/dmenu
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
# dmenu replacement script based on dmenu-term by Rohan Kumar
|
||||
# avaiable here : https://git.sr.ht/~seirdy/term-dmenu
|
||||
#
|
||||
# Sincer abduco is not packaged on Debian, I rewrite this script to work
|
||||
# with file redirection and not a named pipe.
|
||||
|
||||
export FZF_DEFAULT_OPTS="$* $FZF_DEFAULT_OPTS"
|
||||
cleanup() {
|
||||
rm -f $outfile
|
||||
}
|
||||
trap cleanup EXIT
|
||||
outfile=$(mktemp /tmp/dmenu_XXXXX)
|
||||
IFS=$(printf '\n')
|
||||
input=$(cat)
|
||||
export input
|
||||
export outfile
|
||||
|
||||
foot -a launcher bash -c \
|
||||
'echo "$(echo "$input" | fzf)" >$outfile 2>/dev/null' 2>/dev/null
|
||||
|
||||
cat <$outfile
|
||||
# vi:ft=sh
|
Reference in a new issue