summaryrefslogtreecommitdiff
path: root/scripts/pinentry-auto
blob: 66ca97c94550598f3678483a130afe9c81e00ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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