AutoYADM commit: 2025-05-04 18:30:28
This commit is contained in:
parent
a94d5ddb62
commit
4feabcce55
1 changed files with 36 additions and 2 deletions
|
@ -1,6 +1,19 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
set -l action
|
||||||
set -l query (echo username\npassword\ncode | fuzzel --prompt="> " --dmenu)
|
if test (count $argv) -ne 0
|
||||||
|
set action $argv[1]
|
||||||
|
else
|
||||||
|
set action (echo copy\ntype\nshow | fuzzel --prompt="Action> " --dmenu)
|
||||||
|
end
|
||||||
|
set -l query
|
||||||
|
set -l queries username password code
|
||||||
|
if test "$action" = type
|
||||||
|
set --append queries double
|
||||||
|
end
|
||||||
|
set query (string join \n $queries | fuzzel --prompt="Query> " --dmenu)
|
||||||
|
if test -z "$query"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
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"
|
||||||
|
@ -10,8 +23,29 @@ end
|
||||||
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
|
||||||
|
for i in username password
|
||||||
|
set --append output (rbw get "$selected" --raw | jq --join-output ".data.$i")
|
||||||
|
end
|
||||||
else
|
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
|
||||||
|
|
||||||
|
switch $action
|
||||||
|
case copy
|
||||||
|
wl-copy $output
|
||||||
|
case type
|
||||||
|
if test (count $output) -eq 1
|
||||||
|
wtype "$output"
|
||||||
|
else
|
||||||
|
wtype "$output[1]"
|
||||||
|
wtype -k Tab
|
||||||
|
wtype "$output[2]"
|
||||||
|
end
|
||||||
|
case show
|
||||||
|
notify-send --wait "$output"
|
||||||
|
case '*'
|
||||||
|
notify-send "Invalid command!"
|
||||||
|
end
|
||||||
|
|
||||||
wl-copy $output
|
wl-copy $output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue