Files
quartz/content/10-19 LIFE/13 TECH SETUP/13.13 OS SETUP/Shell.md
Quartz Syncer 125a9b1752
All checks were successful
Build and Deploy Quartz / build (push) Successful in 26s
Published multiple files
2026-02-05 09:53:27 -07:00

154 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
publish: true
permalink: /10-19 LIFE/13 TECH SETUP/13.13 OS SETUP/Shell.md
title: Shell
created: 2026-01-29T16:18:01.019-07:00
modified: 2026-02-05T09:44:18.943-07:00
tags:
- shell
- terminal
- bash
cssclasses: ""
---
Shell configuration with Bash, Starship prompt, and Atuin history.
## Starship Prompt
Starship is a fast, customizable prompt that works with any shell.
### Installation
```bash
curl -sS https://starship.rs/install.sh | sh
```
Or via pacman:
```bash
sudo pacman -S starship
```
### Bash Integration
Add to `~/.bashrc`:
```bash
eval "$(starship init bash)"
```
### Configuration
Config location: `~/.config/starship.toml`
```toml
# Minimal prompt
format = """
$directory\
$git_branch\
$git_status\
$character"""
[directory]
truncation_length = 3
truncate_to_repo = true
[git_branch]
symbol = " "
[git_status]
format = '([$all_status$ahead_behind]($style) )'
[character]
success_symbol = "[](green)"
error_symbol = "[](red)"
```
## Atuin (Shell History)
See [[10-19 LIFE/13 TECH SETUP/13.11 APPS/atuin]] for full setup. Quick integration:
```bash
# Install
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
# Add to ~/.bashrc
. "$HOME/.atuin/bin/env"
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)"
```
## My .bashrc Structure
I keep my bashrc clean by sourcing external files:
```bash
# ~/.bashrc
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Basic aliases
alias ls='ls --color=auto'
alias grep='grep --color=auto'
# PATH
export PATH="/home/phil/.local/bin:$PATH"
export PATH="$HOME/.npm-global/bin:$PATH"
export PATH="$PATH:$HOME/go/bin"
# Starship
eval "$(starship init bash)"
# Atuin
. "$HOME/.atuin/bin/env"
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)"
# Custom config (aliases, functions)
source ~/.config/dotfiles/aliases
source ~/.config/dotfiles/functions
# Completions
source <(openclaw completion --shell bash)
```
### Modular Config
Keep aliases and functions in separate files:
```
~/.config/dotfiles/
├── aliases # alias definitions
└── functions # shell functions
```
This keeps `.bashrc` clean and makes it easy to version control customizations separately.
## Useful Tools
```bash
sudo pacman -S \
fzf # Fuzzy finder
bat # Better cat
eza # Better ls
ripgrep # Better grep
fd # Better find
```
### fzf Integration
```bash
# Add to ~/.bashrc
source /usr/share/fzf/key-bindings.bash
source /usr/share/fzf/completion.bash
```
Keybindings:
- `Ctrl+R` — Search history (or use Atuin)
- `Ctrl+T` — Search files
- `Alt+C` — cd into directory
## Resources
- Starship: https://starship.rs/
- Atuin: https://atuin.sh/