aboutsummaryrefslogtreecommitdiff
path: root/private_dot_local/bin/executable_gousermenu.tmpl
blob: 83109a883857a8985b958bd2adebb65bef4fef19 (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
uname="$(gopass ls --flat | dmenu -l 10 -p 'Username: ' | xargs -r gopass show | sed -n '2p')"
# [t]ype or copy
if [ "$1" = "-t" ] ; then
	xdotool type --clearmodifiers "${uname}"
else
	wl-copy -o "${uname}"
	( sleep 30 && wl-copy -c ) &
fi
{{- else }}
uname="$(gopass ls --flat | wmenu -l 10 -p 'Username: ' -f 'Liberation Mono 12px' | xargs -r gopass show | sed -n '2p')"
# [t]ype or copy
if [ "$1" = "-t" ] ; then
	wtype "${uname}"
else
	wl-copy -o "${uname}"
	( sleep 30 && wl-copy -c ) &
fi
{{- end }}