aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2024-03-07 09:00:29 -0700
committerkatherine <ageha@airen-no-jikken.icu>2024-03-07 09:00:29 -0700
commitf0f66dd1db43b52a156576d7306dbe448369c3f0 (patch)
tree60247f3afb34ca63c46868947ee6e267cc2fd002
parent6c0e545800c0bfd3befe548c6572b51fcc628644 (diff)
downloaddotfiles-f0f66dd1db43b52a156576d7306dbe448369c3f0.tar.gz
add otp dmenu
with pass otp
-rwxr-xr-x.config/herbstluftwm/autostart1
-rwxr-xr-x.config/herbstluftwm/otp.sh17
2 files changed, 18 insertions, 0 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart
index 02531ab..b0b4aa5 100755
--- a/.config/herbstluftwm/autostart
+++ b/.config/herbstluftwm/autostart
@@ -162,6 +162,7 @@ hc keybind Mod4-minus spawn dunstctl close-all
#pass
hc keybind Mod4-x spawn ~/.config/herbstluftwm/pass.sh
hc keybind Mod4-Shift-x spawn ~/.config/herbstluftwm/pass.sh -f
+hc keybind Mod4-o spawn ~/.config/herbstluftwm/otp.sh
#scrot-ing
hc keybind Print spawn ~/.config/herbstluftwm/maim.sh
diff --git a/.config/herbstluftwm/otp.sh b/.config/herbstluftwm/otp.sh
new file mode 100755
index 0000000..fc81f13
--- /dev/null
+++ b/.config/herbstluftwm/otp.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env zsh
+
+source ~/.config/init/vars
+
+local password_files
+
+password_files=( ~/.password-store/**/otp-*.gpg )
+password_files=( ${password_files:t:r:s/otp-//} )
+
+printf "%s\n" $password_files | dmenu -fn "${bfont}:size=${bfont_size}" -i \
+ -h "$bheight" -nb "$bar_bg" -nf "$bar_fg" \
+ -sb "$bg_focus" -sf "$fg_focus" \
+ -p "OTP:" | cut -d ')' -f 1 | read choice
+
+[[ -n $choice ]] || exit
+
+pass otp code -c otp-$choice