From 735a06f9cb4766b5d888af02bcf56ead62e8cb4e Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Thu, 12 Dec 2019 17:23:05 -0500 Subject: sway: integrate password-store --- templates/.bin/passmenu | 14 ++++++++++++++ templates/.config/sway/config | 3 +++ 2 files changed, 17 insertions(+) create mode 100755 templates/.bin/passmenu diff --git a/templates/.bin/passmenu b/templates/.bin/passmenu new file mode 100755 index 0000000..8284ff2 --- /dev/null +++ b/templates/.bin/passmenu @@ -0,0 +1,14 @@ +#!/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 + +pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | wl-copy diff --git a/templates/.config/sway/config b/templates/.config/sway/config index 0b78d0c..62ce805 100644 --- a/templates/.config/sway/config +++ b/templates/.config/sway/config @@ -66,6 +66,9 @@ input "1133:16493:Logitech_M705" { # Lock the screen bindsym $mod+Shift+q exec swaylock -c 000000 + # Grab a password + bindsym $mod+Shift+p exec passmenu + # # Moving around: # -- cgit v1.2.3