aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/lpass
blob: 67dbaae55b2e57db9dfbfa3347116e314f2c3008 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/env sh

readonly BIN=/usr/bin/lpass

main()
{
	case "$1" in
		login)
			# Password is stored in pass, read it from there when
			# trying to login
			shift

			export LPASS_DISABLE_PINENTRY=1
			export LPASS_AGENT_TIMEOUT=86400

			pass show "websites/lastpass.com/$1" | "$BIN" login --trust "$@"

			return
			;;
		*)
			# Hand off execution to the regular binary
			exec "$BIN" "$@"
			;;
	esac
}

main "$@"