blob: 00d4aba0ce557ed094fb4b964342ec807ce03cb3 (
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 "${PW}"
( sleep 30 && wl-copy -c ) &
fi
{{- end }}
|