summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-04-29 16:50:14 -0400
committerKjetil Orbekk <kj@orbekk.com>2023-04-29 16:50:14 -0400
commitfcf52ccd41d6241f904aa379703d6b5c7b54b351 (patch)
tree94c486807038951dbaa85e0fd33de141d28fd4ed /common
parent9dbda84dfa311f3d7309088b90c8aaa7f902b900 (diff)
pass settings
Diffstat (limited to 'common')
-rwxr-xr-xcommon/bin/rofipass-wayland22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/bin/rofipass-wayland b/common/bin/rofipass-wayland
new file mode 100755
index 0000000..2dbbd10
--- /dev/null
+++ b/common/bin/rofipass-wayland
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+set -x
+shopt -s nullglob globstar
+
+typeit=0
+if [[ $1 == "--type" ]]; then
+ typeit=1
+ shift
+fi
+
+prefix=${PASSWORD_STORE_DIR-~/.password-store}
+password_files=( "$prefix"/**/*.gpg )
+password_files=( "${password_files[@]#"$prefix"/}" )
+password_files=( "${password_files[@]%.gpg}" )
+
+password=$(printf '%s\n' "${password_files[@]}" | rofi -dmenu "$@")
+
+[[ -n $password ]] || exit
+
+if [[ $typeit -eq 0 ]]; then
+ wl-copy "$(pass show "$password" | head -1)" & sleep 45s && wl-copy -c
+fi