blob: 6c5519fc6993b3e7ef1fae1e1c4b00bf4782db08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
# aliases.sh
# Craig Jennings <c@cjennings.net>
# Shell aliases - works in both bash and zsh
# =============================================================================
# Directory Navigation
# =============================================================================
alias cdot="cd ~/code/archsetup/dotfiles"
alias cdpf="cd ~/projects/finances/"
alias cdpj="cd ~/projects/jr-estate/"
alias cdpd="cd ~/projects/documents/"
# =============================================================================
# File Listing (exa)
# =============================================================================
alias ls="exa --group-directories-first"
alias l="exa -lhF --group-directories-first"
alias ll="exa -lhAF --group-directories-first"
alias lt="exa -lthAF --group-directories-first"
# =============================================================================
# File Operations
# =============================================================================
alias mkd="mkdir -pv"
alias open="xdg-open"
alias linkdel="find . -type l ! -exec test -d {} \; -delete"
alias linkfind="find . -type l ! -exec test -d {} \; -print"
# =============================================================================
# System Administration
# =============================================================================
alias df='dfc -p /dev/'
alias ducks='du -cksh * | sort -rh | head -n11'
alias ntop="sudo bandwhich"
alias ptop="sudo powertop"
alias running_services='systemctl list-units --type=service --state=running'
alias ssn="sudo shutdown now"
alias boot2bios="sudo systemctl reboot --firmware-setup"
alias backup='sudo rsyncshot backup 1000'
alias sysinfo='sudo inxi -v 8 -a -xxxA -xxxB -xxxC -xxxD -xxxG -xxxI -xxxm -xxxN -xxxR -xxxS -xxx --usb -d -I -pl -n -s --slots'
alias timeshift='sudo timeshift-gtk'
alias sysupgrade="topgrade"
# =============================================================================
# Network
# =============================================================================
alias myip='curl -4 https://chroot-me.in/ip/ 2>/dev/null || w3m -4 -dump https://chroot-me.in/ip'
alias whereami="curl ipinfo.io"
alias speedtest="speedtest-go"
# =============================================================================
# Applications
# =============================================================================
alias et="emacs -nw"
alias weather="wego"
alias crm="tickrs -s CRM"
alias handbrake="ghb"
alias smerge="/usr/bin/smerge"
alias stext="/opt/sublime_text/sublime_text"
alias steam="flatpak run com.valvesoftware.Steam"
alias xterm="xterm -ti 340"
# =============================================================================
# Stow (dotfiles management)
# =============================================================================
alias stow="stow --target=/home/cjennings"
# =============================================================================
# Ranger (file manager)
# =============================================================================
alias cdr='. ranger'
alias r='. ranger'
# =============================================================================
# Programming
# =============================================================================
alias cc="gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion -Wextra -std=c2x -pedantic"
alias gdbx="gdb --batch --ex r --ex bt --ex q --args"
# =============================================================================
# Claude Code
# =============================================================================
# hey — launch Claude in the current directory (must be a .ai/ template project).
# If the repo has a remote and FETCH_HEAD is older than 10 minutes, fetches
# first so status info is accurate. Auto-pulls when clean, behind, and not
# ahead; warns for anything ambiguous.
hey() {
if [ ! -f .ai/protocols.org ]; then
echo "hey: no .ai/protocols.org in $(pwd) — not a Claude-template project" >&2
return 1
fi
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
# Fetch upstream if FETCH_HEAD is stale (>10 min) or missing
local fetch_stale=1 gitdir age
gitdir=$(git rev-parse --git-dir 2>/dev/null)
if [ -f "$gitdir/FETCH_HEAD" ]; then
age=$(( $(date +%s) - $(stat -c %Y "$gitdir/FETCH_HEAD" 2>/dev/null || echo 0) ))
[ "$age" -lt 600 ] && fetch_stale=0
fi
[ "$fetch_stale" -eq 1 ] && git fetch --quiet 2>/dev/null
local upstream ahead=0 behind=0 dirty=""
upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)
if [ -n "$upstream" ]; then
ahead=$(git rev-list --count "$upstream..HEAD" 2>/dev/null || echo 0)
behind=$(git rev-list --count "HEAD..$upstream" 2>/dev/null || echo 0)
if ! git diff --quiet 2>/dev/null \
|| ! git diff --cached --quiet 2>/dev/null \
|| [ -n "$(git ls-files --others --exclude-standard 2>/dev/null)" ]; then
dirty="dirty"
fi
# Auto-pull if clean, behind, not ahead
if [ -z "$dirty" ] && [ "${ahead:-0}" -eq 0 ] && [ "${behind:-0}" -gt 0 ]; then
echo "hey: pulling $behind commit(s) from $upstream..." >&2
git pull --ff-only --quiet
elif [ "${ahead:-0}" -gt 0 ] || [ "${behind:-0}" -gt 0 ] || [ -n "$dirty" ]; then
local parts=()
[ "${ahead:-0}" -gt 0 ] && parts+=("↑$ahead")
[ "${behind:-0}" -gt 0 ] && parts+=("↓$behind")
[ -n "$dirty" ] && parts+=("$dirty")
echo "hey: git ${parts[*]}" >&2
fi
fi
fi
claude "Read .ai/protocols.org and follow all instructions."
}
# =============================================================================
# Phenomenology RAG (ollama/deepseek)
# =============================================================================
phenom() {
aichat --rag phenom -m ollama:deepseek-r1:70b "$@"
}
|