From 0416475ee2e9aba54e2356562548a0310efea141 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sun, 4 May 2025 18:46:08 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-04 18:46:08 --- .config/niri/scripts/rbw-fish.fish | 7 +++- .config/niri/scripts/rbw-menu.sh | 44 ---------------------- .config/niri/scripts/rofi-rbw-wrapper.fish | 21 ----------- 3 files changed, 5 insertions(+), 67 deletions(-) delete mode 100644 .config/niri/scripts/rbw-menu.sh delete mode 100755 .config/niri/scripts/rofi-rbw-wrapper.fish diff --git a/.config/niri/scripts/rbw-fish.fish b/.config/niri/scripts/rbw-fish.fish index 27150b3d..a79530d0 100755 --- a/.config/niri/scripts/rbw-fish.fish +++ b/.config/niri/scripts/rbw-fish.fish @@ -1,4 +1,9 @@ #!/usr/bin/env fish + +# This script lets you query entries from bitwarden +# using rbw and fuzzel. You can copy, auto-type, or show in notification. +# Requires wl-copy, wtype, jq, and rbw. + set -l action if test (count $argv) -ne 0 set action $argv[1] @@ -47,5 +52,3 @@ switch $action case '*' notify-send "Invalid command!" end - -wl-copy $output diff --git a/.config/niri/scripts/rbw-menu.sh b/.config/niri/scripts/rbw-menu.sh deleted file mode 100644 index 7b7ad956..00000000 --- a/.config/niri/scripts/rbw-menu.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env sh -set -eu -IFS=' - -' -# Creator: Robert Buchberger -# @robert@spacey.space -# -# Select an item from bitwarden with wofi, return value for passed query -# Dependencies: rbw installed and configured -# -# Usage: rbw-menu [query] -# query: "code" or anything on the login object; username, password, totp, etc -# - code will return a TOTP code -# - anything else will return the value of the query -# default: username - -# Check if rbw is locked, redirect stderr and stdout to /dev/null. Unlock if -# necessary. -rbw unlocked >/dev/null 2>&1 || rbw unlock - -query=${1:-username} - -chosen_item=$( - # If RBW_MENU_COMMAND is unset, use wofi - if [ "${RBW_MENU_COMMAND:-}" = "" ]; then - rbw list | wofi --dmenu --matching fuzzy --insensitive --prompt "$query" - else - eval "rbw list | $RBW_MENU_COMMAND" - fi -) - -# Exit if user didn't select anything -[ "$chosen_item" = "" ] && exit 1 - -case "$query" in -code) - rbw code "$chosen_item" - ;; -*) - # Select chosen item from vault, return login.query - rbw get "$chosen_item" --raw | jq --join-output ".data.$query" - ;; -esac diff --git a/.config/niri/scripts/rofi-rbw-wrapper.fish b/.config/niri/scripts/rofi-rbw-wrapper.fish deleted file mode 100755 index dfa15f91..00000000 --- a/.config/niri/scripts/rofi-rbw-wrapper.fish +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env fish - -set -l opts --selector fuzzel --clipboarder wl-copy --typer wtype --use-notify-send - -set -l cmd (echo type\ncopy\nprint\n | fuzzel --prompt="Mode: " --dmenu) - -set -l target (echo username\npassword\nautotype | fuzzel --prompt="Targets: " --dmenu) - -if not test "$target" = both - set --append opts --target $target -end - -if test "$cmd" = type - rofi-rbw $opts --action type -else if test "$cmd" = copy - rofi-rbw $opts --action copy -else if test "$cmd" = print - notify-send --wait (rofi-rbw $opts --action print | string collect -N) -else - return 1 -end