AutoYADM commit: 2025-05-05 14:42:13
This commit is contained in:
parent
3858e5943f
commit
369ede739c
3 changed files with 27 additions and 4 deletions
|
@ -207,6 +207,10 @@ window-rule {
|
||||||
match app-id="^spotify$"
|
match app-id="^spotify$"
|
||||||
open-on-workspace "music"
|
open-on-workspace "music"
|
||||||
}
|
}
|
||||||
|
window-rule {
|
||||||
|
match app-id="footfloat"
|
||||||
|
open-floating true
|
||||||
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
// This regular expression is intentionally made as specific as possible,
|
// This regular expression is intentionally made as specific as possible,
|
||||||
// since this is the default config, and we want no false positives.
|
// since this is the default config, and we want no false positives.
|
||||||
|
|
|
@ -3,15 +3,22 @@
|
||||||
# This script lets you query entries from bitwarden
|
# This script lets you query entries from bitwarden
|
||||||
# using rbw and fuzzel. You can copy, auto-type, or show in notification.
|
# using rbw and fuzzel. You can copy, auto-type, or show in notification.
|
||||||
# Requires wl-copy, wtype, jq, and rbw.
|
# Requires wl-copy, wtype, jq, and rbw.
|
||||||
|
# Intended use: bind this to a key in your window manager
|
||||||
|
|
||||||
# unlock vault if needed
|
# unlock vault if needed
|
||||||
# Note: launches foot with 'footfloat' app-id
|
# Note: launches foot with 'footfloat' app-id
|
||||||
# so Niri sets it as floating with the appropriate
|
# You can use a window rule in your compositor
|
||||||
# window rule
|
# to display this as a floating window if you wish
|
||||||
|
# This is to accommodate pinentry-curses or tty
|
||||||
if not rbw unlocked
|
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
|
end
|
||||||
|
|
||||||
|
# check if action was given as arg, prompt otherwise
|
||||||
set -l action
|
set -l action
|
||||||
if test (count $argv) -ne 0
|
if test (count $argv) -ne 0
|
||||||
set action $argv[1]
|
set action $argv[1]
|
||||||
|
@ -21,8 +28,11 @@ end
|
||||||
if test -z "$action"
|
if test -z "$action"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# prompt for query
|
||||||
set -l query
|
set -l query
|
||||||
set -l queries username password code
|
set -l queries username password code
|
||||||
|
# double query only availably for type action
|
||||||
if test "$action" = type
|
if test "$action" = type
|
||||||
set --append queries double
|
set --append queries double
|
||||||
end
|
end
|
||||||
|
@ -31,15 +41,19 @@ if test -z "$query"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# prompt for account selection
|
||||||
|
# $selected is the entry's name used for lookup
|
||||||
set -l selected (rbw list | fuzzel --prompt="$query: " --dmenu)
|
set -l selected (rbw list | fuzzel --prompt="$query: " --dmenu)
|
||||||
if test -z "$selected"
|
if test -z "$selected"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# get answer to the query for the selected account
|
||||||
set -l output
|
set -l output
|
||||||
if test "$query" = code
|
if test "$query" = code
|
||||||
set output (rbw code "$selected")
|
set output (rbw code "$selected")
|
||||||
else if test "$query" = double
|
else if test "$query" = double
|
||||||
|
# special case
|
||||||
for i in username password
|
for i in username password
|
||||||
set --append output (rbw get "$selected" --raw | jq --join-output ".data.$i")
|
set --append output (rbw get "$selected" --raw | jq --join-output ".data.$i")
|
||||||
end
|
end
|
||||||
|
@ -47,6 +61,7 @@ else
|
||||||
set output (rbw get "$selected" --raw | jq --join-output ".data.$query")
|
set output (rbw get "$selected" --raw | jq --join-output ".data.$query")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# finally process the output according to action
|
||||||
switch $action
|
switch $action
|
||||||
case copy
|
case copy
|
||||||
wl-copy $output
|
wl-copy $output
|
||||||
|
@ -54,11 +69,15 @@ switch $action
|
||||||
if test (count $output) -eq 1
|
if test (count $output) -eq 1
|
||||||
wtype "$output"
|
wtype "$output"
|
||||||
else
|
else
|
||||||
|
# special case for double action
|
||||||
|
# to type both user and pass
|
||||||
wtype "$output[1]"
|
wtype "$output[1]"
|
||||||
wtype -k Tab
|
wtype -k Tab
|
||||||
wtype "$output[2]"
|
wtype "$output[2]"
|
||||||
end
|
end
|
||||||
case show
|
case show
|
||||||
|
# notification doesn't time out
|
||||||
|
# until closed by user
|
||||||
notify-send --wait "$output"
|
notify-send --wait "$output"
|
||||||
case '*'
|
case '*'
|
||||||
notify-send "Invalid command!"
|
notify-send "Invalid command!"
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
"notifications_url": null,
|
"notifications_url": null,
|
||||||
"lock_timeout": 3600,
|
"lock_timeout": 3600,
|
||||||
"sync_interval": 3600,
|
"sync_interval": 3600,
|
||||||
"pinentry": "pinentry",
|
"pinentry": "pinentry-curses",
|
||||||
"client_cert_path": null
|
"client_cert_path": null
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue