diff --git a/.install-password-manager.sh b/.install-password-manager.sh new file mode 100644 index 0000000..a4c72bb --- /dev/null +++ b/.install-password-manager.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# exit immediately if password-manager-binary is already in $PATH +type rbw >/dev/null 2>&1 && exit + +# pacman based distros +if type pacman >/dev/null 2>&1; then + sudo pacman -S rbw +# apt based distros +elif type apt >/dev/null 2>&1; then + sudo apt install rbw +# dnf based distros +elif type dnf >/dev/null 2>&1; then + sudo dnf install rbw + +rbw config set email "ir.shoebottom@gmail.com" +rbw config set base_url "https://bitwarden.shoebottom.ca" +rbw login \ No newline at end of file diff --git a/dot_config/chezmoi/chezmoi.toml.tmpl b/dot_config/chezmoi/chezmoi.toml.tmpl index ee3bba2..e2d71ee 100644 --- a/dot_config/chezmoi/chezmoi.toml.tmpl +++ b/dot_config/chezmoi/chezmoi.toml.tmpl @@ -4,4 +4,6 @@ encryption = "age" recipient = "age1eshsd8qvaq0z4achjezvrw4spc57a7a72xp7ej663qlk6lnets2sjvkuy6" [edit] command = "code" - args = ["--wait"] \ No newline at end of file + args = ["--wait"] +[hooks.read-source-state.pre] + command = ".local/share/chezmoi/.install-password-manager.sh" \ No newline at end of file