2024-05-04 21:05:33 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# @file Atuin Initialization
|
|
|
|
# @brief Registers with atuin, logs in, imports command history, and synchronizes
|
|
|
|
|
|
|
|
if command -v atuin > /dev/null; then
|
|
|
|
source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/private.sh"
|
2024-05-09 19:53:38 -07:00
|
|
|
logg info 'Registering Atuin account'
|
2024-05-04 21:05:33 -07:00
|
|
|
atuin register -u "$ATUIN_USERNAME" -e "$ATUIN_EMAIL" -p "$ATUIN_PASSWORD"
|
2024-05-09 19:53:38 -07:00
|
|
|
logg info 'Logging into Atuin account'
|
2024-05-04 21:05:33 -07:00
|
|
|
atuin login -u "$ATUIN_USERNAME" -p "$ATUIN_PASSWORD" -k "$ATUIN_KEY"
|
2024-05-09 19:53:38 -07:00
|
|
|
logg info 'Running atuin import auto'
|
2024-05-04 21:05:33 -07:00
|
|
|
atuin import auto
|
2024-05-09 19:53:38 -07:00
|
|
|
logg info 'Running atuin sync'
|
2024-05-04 21:05:33 -07:00
|
|
|
atuin sync
|
|
|
|
else
|
|
|
|
logg info 'atuin is not available in the PATH'
|
|
|
|
fi
|