diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-10-07 21:53:35 -0400 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-10-07 21:53:35 -0400 |
commit | c2ed84f6632a9c3521242ad7e2d8ae4e1e8c5770 (patch) | |
tree | 2634a535fda30d4a654b9e8128b87ff0233298b4 /bin | |
parent | 9ae9f06d2012167fcc6f91f2f28f98eced01365a (diff) | |
parent | 820bd83a3d969c6ec2e48d0421e41cffcc7c0c95 (diff) |
Merge branch 'master' of tesuji.6.orbekk.com:/storage/projects/dotfiles
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/P | 24 | ||||
-rwxr-xr-x | bin/dmenu_run.sh | 3 |
2 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +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[@]}" | dmenu -fn "-*-*-*-*-*-*-20-*-*-*-*-*-*-*" "$@") + +[[ -n $password ]] || exit + +if [[ $typeit -eq 0 ]]; then + pass show -c "$password" 2>/dev/null +else + xdotool - <<<"type --clearmodifiers -- $(pass show "$password" | head -n 1)" +fi diff --git a/bin/dmenu_run.sh b/bin/dmenu_run.sh new file mode 100755 index 0000000..9255d07 --- /dev/null +++ b/bin/dmenu_run.sh @@ -0,0 +1,3 @@ +#!/bin/bash +PATH=$HOME/dotfiles/bin:$HOME/bin:$PATH dmenu_run -fn -*-*-*-*-*-*-20-*-*-*-*-*-*-* "$@" + |