aboutsummaryrefslogtreecommitdiff
path: root/private_dot_local/bin/executable_gopassmenu.tmpl
blob: 82fed5c667cbe1179bf3debd1bf6d22afa49da15 (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 | wmenu -l 15 -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 }}