summaryrefslogtreecommitdiff
path: root/scripts/pinentry-auto
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/pinentry-auto')
-rwxr-xr-xscripts/pinentry-auto9
1 files changed, 8 insertions, 1 deletions
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 "$@"