summaryrefslogtreecommitdiff
path: root/scripts/pinentry-auto
blob: d9c7bda12675c261c38668b36fc0b864c49c5c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
set -Ceu

# 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 "$@"
fi