dotfiles/.chezmoiscripts/run_before_10-unlock-bw.sh.tmpl
punkfairie 519d97cb75
Add .chezmoiscripts/10-unlock-bw.sh
Update .config/packages/archgirlie
2024-09-29 16:07:51 -07:00

13 lines
290 B
Bash

#!/usr/bin/env sh
type bw >/dev/null 2>&1 || exit
pass={{ joinPath .chezmoi.sourceDir ".bw-password.asc" | include | decrypt }}
if ! bw login --check; then
BW_SESSION=$(bw login "bitwarden@punkfairie.net" "$pass" --raw)
else
BW_SESSION=$(bw unlock "$pass" --raw)
fi
export BW_SESSION