AutoYADM commit: 2025-05-04 18:46:08

This commit is contained in:
Daniel Fichtinger 2025-05-04 18:46:08 -04:00
parent 4feabcce55
commit 0416475ee2
3 changed files with 5 additions and 67 deletions

View file

@ -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

View file

@ -1,44 +0,0 @@
#!/usr/bin/env sh
set -eu
IFS='
'
# Creator: Robert Buchberger <robert@buchberger.cc>
# @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

View file

@ -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