AutoYADM commit: 2025-05-05 14:42:13

This commit is contained in:
Daniel Fichtinger 2025-05-05 14:42:13 -04:00
parent 3858e5943f
commit 369ede739c
3 changed files with 27 additions and 4 deletions

View file

@ -207,6 +207,10 @@ window-rule {
match app-id="^spotify$"
open-on-workspace "music"
}
window-rule {
match app-id="footfloat"
open-floating true
}
window-rule {
// This regular expression is intentionally made as specific as possible,
// since this is the default config, and we want no false positives.

View file

@ -3,15 +3,22 @@
# 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.
# Intended use: bind this to a key in your window manager
# unlock vault if needed
# Note: launches foot with 'footfloat' app-id
# so Niri sets it as floating with the appropriate
# window rule
# You can use a window rule in your compositor
# to display this as a floating window if you wish
# This is to accommodate pinentry-curses or tty
if not rbw unlocked
rbw unlock
foot -w 750x500 -a footfloat rbw unlock
# if the unlock failed we quit early
if not rbw unlocked
return 1
end
end
# check if action was given as arg, prompt otherwise
set -l action
if test (count $argv) -ne 0
set action $argv[1]
@ -21,8 +28,11 @@ end
if test -z "$action"
return 1
end
# prompt for query
set -l query
set -l queries username password code
# double query only availably for type action
if test "$action" = type
set --append queries double
end
@ -31,15 +41,19 @@ if test -z "$query"
return 1
end
# prompt for account selection
# $selected is the entry's name used for lookup
set -l selected (rbw list | fuzzel --prompt="$query: " --dmenu)
if test -z "$selected"
return 1
end
# get answer to the query for the selected account
set -l output
if test "$query" = code
set output (rbw code "$selected")
else if test "$query" = double
# special case
for i in username password
set --append output (rbw get "$selected" --raw | jq --join-output ".data.$i")
end
@ -47,6 +61,7 @@ else
set output (rbw get "$selected" --raw | jq --join-output ".data.$query")
end
# finally process the output according to action
switch $action
case copy
wl-copy $output
@ -54,11 +69,15 @@ switch $action
if test (count $output) -eq 1
wtype "$output"
else
# special case for double action
# to type both user and pass
wtype "$output[1]"
wtype -k Tab
wtype "$output[2]"
end
case show
# notification doesn't time out
# until closed by user
notify-send --wait "$output"
case '*'
notify-send "Invalid command!"

View file

@ -7,6 +7,6 @@
"notifications_url": null,
"lock_timeout": 3600,
"sync_interval": 3600,
"pinentry": "pinentry",
"pinentry": "pinentry-curses",
"client_cert_path": null
}