My dotfiles. I use chezmoi for managing my dotfiles locally. As I am discovering Emacs and Org mode, I will try to write a bash script to automate some customisations, with litterate codding and babel tangling. I will also use charm gum to make this script pretty.
The script use Charm Gum, so the beginning is shebang and test if gum is present in $PATH. Do nit forget to change the permissions to be executable.
chmod +x script.sh
#!/usr/bin/env bash
command -v gum >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Gum is NOT in PATH. You can visit https://github.com/charmbracelet/gum to install it"
exit 1
fiYou need to meet the prequisites of installing doom emacs first. Otherwise exit the script and install the necessary packages.
gum confirm "configure doom ?" && git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs && ~/.config/emacs/bin/doom installThis part needs chezmoi and a github public repo containing your dotfiles.
echo "In order to continue with setting up your dotfiles"
echo "you need to have a github public repo containing"
echo "your dotfiles."
echo "If you don't, you can continue installing your dotfiles"
echo "with chez moi by following the documentation on"
echo "the website: https://www.chezmoi.io/quick-start/"
dotfiles(){
command -v chezmoi >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Chezmoi is NOT in PATH. You can visit https://www.chezmoi.io/install/ to install it"
read -n 1 -s -r -p "Press any key to exit..."
fi
GITHUB_USERNAME=$(gum input --placeholder "your github username")
DOTFILES_REPO_NAME=$(gum input --placeholder "your dotfiles repo")
chezmoi init --apply --verbose https://github.com/$GITHUB_USERNAME/$DOTFILES_REPO_NAME.git
}
gum confirm "continue with dotfiles?" && dotfilesAs I only use very few plugins for tmux, I configure it manually.
gum confirm "add Catppuccin themes for tmux" && mkdir -p ~/.tmux/plugins/catppuccin && git clone -b v2.1.3 https://github.com/catppuccin/tmux.git ~/.tmux/plugins/catppuccin/tmux