summaryrefslogtreecommitdiff
path: root/scripts/pinentry-auto
blob: 54e59c2c0eaa01a4f8180a24fc89de469e16e19b (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|Xorg' > /dev/null; then
	/home/"$USER"/bin/pinentry-dmenu "$@"
else
	pinentry-curses "$@"
fi