diff options
| author | Robert Günzler <r@gnzler.io> | 2023-01-07 19:06:49 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2023-01-07 19:06:49 +0100 |
| commit | 4a7d562e8ba26b2d5c5f7cc74637c7a51d8bc7a2 (patch) | |
| tree | faf8e36a53f9685f3282d55e48dc457c8d90f4da | |
| parent | 372fa7bbda00452a081440edfe5dd58439156e98 (diff) | |
bin/secretmenu: use upstreamed bemenu patches
Signed-off-by: Robert Günzler <r@gnzler.io>
| -rwxr-xr-x | bin/secretmenu | 16 | ||||
| -rwxr-xr-x | bin/soundswitch | 2 |
2 files changed, 6 insertions, 12 deletions
diff --git a/bin/secretmenu b/bin/secretmenu index 0ba9754..386d870 100755 --- a/bin/secretmenu +++ b/bin/secretmenu @@ -8,15 +8,13 @@ trap '{ notify-send -a secretmenu -i "${ico}" -c error "secretmenu: failed :(" " secretmgr=rbw printpass= -first= -while getopts bpP1h name; do +while getopts bpPh name; do case ${name} in b) secretmgr=rbw ;; p) secretmgr=pass ;; P) printpass=1 ;; - 1) first=1 ;; h | ?) - echo "usage: secretmenu [-bp] [-P] [-1] [query]" + echo "usage: secretmenu [-bp] [-P] [query]" echo exit 2 ;; @@ -26,10 +24,10 @@ shift $((OPTIND - 1)) if [ "$secretmgr" = "rbw" ] && command -v rbw >/dev/null 2>&1; then __list_secrets() { - rbw list --fields user,name | tr '\t' '@' + rbw list --fields name,user,id | column -t -s $'\t' } __query_secret() { - rbw get --full $(awk -F@ '{print $2 " " $1}' <<<"$1") 2>&1 + rbw get --full -- "${1##* }" 2>&1 } fi if [ "$secretmgr" = "pass" ] && command -v pass >/dev/null 2>&1; then @@ -70,15 +68,11 @@ done # fi __menu() { - if [ -n "$first" ]; then - grep "$@" | head -n1 - return - fi if [ -t 1 ]; then echo "terminal mode not implemented" exit 1 fi - MENU_PROMPT=" secret" menu --accept-single ${@:+--filter "$@"} + MENU_PROMPT=" secret" menu --list=10 --accept-single ${@:+--filter "$@"} } pw=$({ diff --git a/bin/soundswitch b/bin/soundswitch index 78021b6..cc1de6c 100755 --- a/bin/soundswitch +++ b/bin/soundswitch @@ -25,7 +25,7 @@ HDMI_PROFILE="output:hdmi-stereo" _menu() { [ -n "${mode}" ] && prompt="soundswitch (${mode})" || prompt="soundswitch" export MENU_PROMPT=${MENU_PROMPT:-${prompt}} - menu -l10 --ifne --autoselect + menu -l10 --ifne --accept-single } mode= |