l: override dmenu with fzfmenu
This commit is contained in:
parent
4122e3efd5
commit
cef8060bed
|
@ -126,6 +126,12 @@ in {
|
|||
restartIfChanged = false;
|
||||
};
|
||||
|
||||
nixpkgs.config.packageOverrides = super: {
|
||||
dmenu = pkgs.writeDashBin "dmenu" ''
|
||||
${pkgs.fzfmenu}/bin/fzfmenu "$@"
|
||||
'';
|
||||
};
|
||||
|
||||
krebs.xresources.enable = true;
|
||||
lass.screenlock.enable = true;
|
||||
}
|
||||
|
|
33
lass/5pkgs/fzfmenu/default.nix
Normal file
33
lass/5pkgs/fzfmenu/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
pkgs.writeDashBin "fzfmenu" ''
|
||||
set -efu
|
||||
PROMPT=">"
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
-p)
|
||||
PROMPT="$2"
|
||||
shift
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option $1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
INPUT=$(${pkgs.coreutils}/bin/cat)
|
||||
OUTPUT="$(${pkgs.coreutils}/bin/mktemp)"
|
||||
${pkgs.rxvt_unicode}/bin/urxvt \
|
||||
-name fzfmenu -title fzfmenu \
|
||||
-e ${pkgs.dash}/bin/dash -c \
|
||||
"echo \"$INPUT\" | ${pkgs.fzf}/bin/fzf \
|
||||
--history=/dev/null \
|
||||
--no-sort \
|
||||
--prompt=\"$PROMPT\" \
|
||||
> \"$OUTPUT\"" 2>/dev/null
|
||||
${pkgs.coreutils}/bin/cat "$OUTPUT"
|
||||
${pkgs.coreutils}/bin/rm "$OUTPUT"
|
||||
''
|
Loading…
Reference in a new issue