summaryrefslogtreecommitdiff
path: root/packages/cern-scripts/src/main/resources/bin/dmenu-pass.sh
diff options
context:
space:
mode:
authorYves Fischer <yvesf@cern.ch>2016-02-01 09:09:31 +0100
committerYves Fischer <yvesf@cern.ch>2016-02-01 09:09:43 +0100
commit3cbe8700c8c6cb1ac41b506681234f995ca979ba (patch)
tree01b6f4e232e23ff9cf5379137a472796784d1abe /packages/cern-scripts/src/main/resources/bin/dmenu-pass.sh
parent4de2d5afc7dfdb0409d2ac9359bbe5bac58e2edc (diff)
downloaddebian-packages-3cbe8700c8c6cb1ac41b506681234f995ca979ba.tar.gz
debian-packages-3cbe8700c8c6cb1ac41b506681234f995ca979ba.zip
cern-scripts: restructure source directory
Diffstat (limited to 'packages/cern-scripts/src/main/resources/bin/dmenu-pass.sh')
-rwxr-xr-xpackages/cern-scripts/src/main/resources/bin/dmenu-pass.sh40
1 files changed, 0 insertions, 40 deletions
diff --git a/packages/cern-scripts/src/main/resources/bin/dmenu-pass.sh b/packages/cern-scripts/src/main/resources/bin/dmenu-pass.sh
deleted file mode 100755
index bb3be7a..0000000
--- a/packages/cern-scripts/src/main/resources/bin/dmenu-pass.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-
-shopt -s nullglob globstar
-
-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[@]}" | dmenu "$@")
-
-[[ -n $password ]] || exit
-
-while true; do
- pass show "$password" 2>&1 \
- | sed -e 's/^pass:.*/pass: XXXX/' \
- | xmessage -file - \
- -buttons "Done:1,Copy 'login':2,Copy 'pass':3,Copy all:4" \
- -default "Done" \
- -nearmouse -timeout 10
- case "$?" in
- 2)
- pass show "$password" 2>&1 \
- | sed -ne 's/^login: \(.*\)/\1/p' \
- | xclip -i -verbose -l 1 2>/dev/null
- ;;
- 3)
- pass show "$password" 2>&1 \
- | sed -ne 's/^pass: \(.*\)/\1/p' \
- | xclip -i -verbose -l 1 2>/dev/null
- ;;
- 4)
- pass show "$password" 2>&1 \
- | xclip -i -verbose -l 1 2>/dev/null
- ;;
- *)
- break
- ;;
- esac
-done