summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2021-11-07 11:20:10 +0100
committerTom Barrett <tom@tombarrett.xyz>2021-11-07 11:20:10 +0100
commit7ca519190e5be40ccae0d8b12a17c36e5469e230 (patch)
treed9b56f83e28b288e97751f1bdd09061107baeb10 /scripts
parentf16cd1633c4b3dc0c4dbcd84a53a71ba24dbc136 (diff)
works for nix now too
Diffstat (limited to 'scripts')
-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 "$@"