aboutsummaryrefslogtreecommitdiff
path: root/private_dot_local/bin/executable_gousermenu.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'private_dot_local/bin/executable_gousermenu.tmpl')
-rw-r--r--private_dot_local/bin/executable_gousermenu.tmpl22
1 files changed, 22 insertions, 0 deletions
diff --git a/private_dot_local/bin/executable_gousermenu.tmpl b/private_dot_local/bin/executable_gousermenu.tmpl
new file mode 100644
index 0000000..83109a8
--- /dev/null
+++ b/private_dot_local/bin/executable_gousermenu.tmpl
@@ -0,0 +1,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 }}