diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2023-04-29 16:50:14 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2023-04-29 16:50:14 -0400 |
commit | fcf52ccd41d6241f904aa379703d6b5c7b54b351 (patch) | |
tree | 94c486807038951dbaa85e0fd33de141d28fd4ed /common | |
parent | 9dbda84dfa311f3d7309088b90c8aaa7f902b900 (diff) |
pass settings
Diffstat (limited to 'common')
-rwxr-xr-x | common/bin/rofipass-wayland | 22 |
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 |