From 4a09ad65e04100582697be13796409fb228a68cf Mon Sep 17 00:00:00 2001 From: Ryan Chan Date: Wed, 7 Sep 2022 21:11:18 +0100 Subject: [PATCH] Add dmenu scripts for pass --- bash/.bashrc | 8 ++++++++ bin/dmenu_pass_otp | 5 +++++ gnupg/gpg-agent.conf | 3 +-- sxhkd/sxhkdrc | 13 +++++++++---- 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100755 bin/dmenu_pass_otp diff --git a/bash/.bashrc b/bash/.bashrc index c0b2a2f..b6a9a1c 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -7,6 +7,14 @@ alias ls="ls --color=auto" alias ll="ls -l -all --classify" alias grep="grep --color=auto" +# dmenu options +dmenu_options="\ + -fn Roboto\ Mono:style=Medium:antialias=true:autohint=true:pixelsize=13\ + -nb \#dadada -nf \#4e4e4e -sb \#4e4e4e -sf \#dadada" +alias dmenu_run="dmenu_run ""$dmenu_options" +alias passmenu="passmenu ""$dmenu_options" +alias dmenu_pass_otp="dmenu_pass_otp ""$dmenu_options" + # TODO: Add colors to the prompt. PS1="[\u@\h:\w]\$ " diff --git a/bin/dmenu_pass_otp b/bin/dmenu_pass_otp new file mode 100755 index 0000000..1178713 --- /dev/null +++ b/bin/dmenu_pass_otp @@ -0,0 +1,5 @@ +#!/bin/sh + +password=$(find ~/.password-store/ -type f -name '*.gpg' | + sed 's/.*\.password-store\/\(.*\)\.gpg$/\1/' | dmenu -i "$@") +[ -n "$password" ] && pass otp show -c "$password" diff --git a/gnupg/gpg-agent.conf b/gnupg/gpg-agent.conf index e63e4e5..f346c3b 100644 --- a/gnupg/gpg-agent.conf +++ b/gnupg/gpg-agent.conf @@ -1,3 +1,2 @@ enable-ssh-support - -pinentry-program /usr/bin/pinentry-tty +pinentry-program /usr/bin/pinentry-gtk-2 diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc index 99959bf..7bafd1a 100644 --- a/sxhkd/sxhkdrc +++ b/sxhkd/sxhkdrc @@ -10,8 +10,13 @@ super + shift + Return st -e tmux -2 attach-session super + r - dmenu_run -fn "Roboto Mono:style=Medium:antialias=true:autohint=true:pixelsize=13" \ - -nb "#dadada" -nf "#4e4e4e" -sb "#4e4e4e" -sf "#dadada" + bash -ic dmenu_run + +super + p + bash -ic passmenu + +super + o + bash -ic dmenu_pass_otp # Reload sxhkd configs. super + Escape @@ -93,7 +98,7 @@ super + {_,shift + }{h,j,k,l} bspc node -{f,s} {west,south,north,east} # Focus the node for the given path jump. -super + {p,b,comma,period} +super + shift + {p,b,comma,period} bspc node -f @{parent,brother,first,second} # Focus the next/previous node in the current desktop. @@ -109,7 +114,7 @@ super + {grave,Tab} bspc {node,desktop} -f last # Focus the older or newer node in the focus history. -super + {o,i} +super + shift + {o,i} bspc wm -h off; \ bspc node {older,newer} -f; \ bspc wm -h on -- 2.38.5