From 7ca519190e5be40ccae0d8b12a17c36e5469e230 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sun, 7 Nov 2021 11:20:10 +0100 Subject: works for nix now too --- scripts/pinentry-auto | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/pinentry-auto b/scripts/pinentry-auto index 4b90cc1..d9c7bda 100755 --- a/scripts/pinentry-auto +++ b/scripts/pinentry-auto @@ -1,7 +1,14 @@ #!/bin/sh set -Ceu -if ps -e | grep -q X; then +# for nixos +exists=$(command -v pgrep || echo "") +if [ -z "$exists" ]; then + PATH="/run/current-system/sw/bin/:"$PATH +fi + + +if pgrep -x X > /dev/null; then /home/"$USER"/bin/pinentry-dmenu "$@" else pinentry-curses "$@" -- cgit v1.2.3