aboutsummaryrefslogtreecommitdiff
path: root/private_dot_local/bin/executable_gopassmenu.tmpl
blob: afa72b5fc5c25bfe6babf753edaf4531e4b4ef91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

{{- if eq .wm "x11" }}
# Home laptop
PW="$(gopass ls --flat | dmenu -l 15 -p 'Password: ' | xargs -r gopass show | head -n1)"
# [t]ype or copy
if [ "$1" = "-t" ] ; then
	xdotool type --delay 1 --clearmodifiers "${PW}"
else
	printf "${PW}" | xsel -ib -t 30000
fi
{{- else }}
PW="$(gopass ls --flat | wofi -d -l2 -k /dev/null -p 'Password: ' | xargs -r gopass show | head -n1)"
# [t]ype or copy
if [ "$1" = "-t" ] ; then
	wtype "${PW}"
else
	wl-copy "${PW}"
	( sleep 30 && wl-copy -c ) &
fi
{{- end }}