From 5f9da8b532c7b762107da76d53266621ab6b0089 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Tue, 16 Mar 2021 10:50:03 +0100 Subject: [PATCH] add otp and student snippets --- local/bin/delegator | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/local/bin/delegator b/local/bin/delegator index 0ffe00c..1abed81 100755 --- a/local/bin/delegator +++ b/local/bin/delegator @@ -26,6 +26,8 @@ password clipboard selection run +otp +student HERE )" @@ -36,7 +38,7 @@ case "$choice" in ;; 'password') choice="$(cd ~/.password-store; find * -name '*.gpg' | sed 's/\.gpg$//' | sort -d | pick)" - inject "$(pass show $choice | head -1)" + inject "$(pass show "$choice" | head -1)" ;; 'clipboard') inject "$(xclip -o -sel c)" @@ -48,4 +50,12 @@ case "$choice" in choice="$(dmenu_path | pick)" exec "$choice" ;; +'otp') + choice="$(cd ~/.password-store/otp; find * -name '*.gpg' | sed 's/\.gpg$//' | sort -d | pick)" + inject "$(pass otp code otp/"$choice" | head -1)" + ;; +'student') + choice="$(pick < /data/courses/students.csv)" + inject "$choice" + ;; esac