Adds bitwarden
This commit is contained in:
parent
e798bb5e1f
commit
a301315f2a
8 changed files with 84 additions and 15 deletions
42
.config/hypr/scripts/Bitwarden.sh
Executable file
42
.config/hypr/scripts/Bitwarden.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/env sh
|
||||
|
||||
declare -A actions
|
||||
actions['Sync']="sync"
|
||||
actions["Logout"]="logout"
|
||||
actions["Lock"]="lock"
|
||||
|
||||
printSelection() {
|
||||
echo "$1"
|
||||
for key in "${!fruits[@]}"
|
||||
do
|
||||
echo "Action: $key"
|
||||
done
|
||||
}
|
||||
|
||||
formattedIDs=$(echo "format:[NAME] ([USERNAME])" | nc -U /tmp/bitwarden-daemon.sock)
|
||||
|
||||
selectionList=$(echo "$formattedIDs" | jq 'keys | map("\(.)\n") | add' -r)
|
||||
actionSelectionList=$(printf "Actions: %s\n" ${!actions[@]})
|
||||
selection=$(printf "%s\n" "$selectionList" "$actionSelectionList" | anyrun --plugins libstdin.so)
|
||||
|
||||
echo "$selection"
|
||||
|
||||
if [[ $selection == '' ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $selection == Actions:* ]]; then
|
||||
actionKey="${selection:9}"
|
||||
action="${actions[$actionKey]}"
|
||||
echo "Performing: $action"
|
||||
|
||||
echo "$action:" | nc -U /tmp/bitwarden-daemon.sock
|
||||
else
|
||||
id=$(echo "$formattedIDs" | jq ".[\"${selection}\"]" -r)
|
||||
echo "lookupPassword:$id" | nc -U /tmp/bitwarden-daemon.sock | wl-copy
|
||||
|
||||
notify-send "Password copied" "Copied password for '$selection' to clipboard."
|
||||
fi
|
||||
|
||||
exit 0;
|
||||
|
||||
15
.config/hypr/scripts/Toolkit.sh
Executable file
15
.config/hypr/scripts/Toolkit.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/env sh
|
||||
|
||||
SCRIPTS_DIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
declare -A scripts
|
||||
scripts["Shutdown"]="systemctl poweroff"
|
||||
scripts["Reboot"]="systemctl reboot"
|
||||
scripts["Logout"]="logout terminate-user $USER"
|
||||
scripts["Lock"]="$SCRIPTS_DIR/LockScreen.sh"
|
||||
scripts["Notification Center (SwayNC)"]="swaync-client -t -sw"
|
||||
|
||||
selected=$(printf "%s\n" "${!scripts[@]}" | anyrun --plugins libstdin.so)
|
||||
|
||||
command="${scripts[$selected]}"
|
||||
$command
|
||||
Loading…
Add table
Add a link
Reference in a new issue