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

{{- if eq .chezmoi.hostname "Aragorn" }}
# Home laptop
PW="$(gopass ls --flat | dmenu -l 10 -p 'Password: ' | xargs -r gopass show | head -n1)"
# [t]ype or copy
if [ "$1" = "-t" ] ; then
	xdotool type --clearmodifiers "${PW}"
else
	wl-copy -o "${PW}"
	( sleep 30 && wl-copy -c ) &
fi
{{- else }}
PW="$(gopass ls --flat | wmenu -l 10 -p 'Password: ' -f 'Liberation Mono 12px' | xargs -r gopass show | head -n1)"
# [t]ype or copy
if [ "$1" = "-t" ] ; then
	wtype "${PW}"
else
	wl-copy -o "${PW}"
	( sleep 30 && wl-copy -c ) &
fi
{{- end }}