repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
modern.zshShell74 lines3.4 KiBraw download
#!/usr/bin/env zsh
# ── modern.zsh : modern CLI replacements (btop/dust/duf/procs/delta/…) ────────
# Each is guarded so a missing binary never errors. Real coreutils stay intact —
# we add memorable aliases, we do NOT shadow cat/ps/du/df/top (scripts depend on
# the originals). Cheat card: `cheat modern`.

# ── bat : syntax-highlighted pager (cat stays the real cat) ──────────────────
if (( $+commands[bat] )); then
  export BAT_THEME="Rose Pine"
  alias b='bat'
  alias bcat='bat --style=plain --paging=never'   # cat-like, still highlighted
  alias bl='bat --style=full'                      # line numbers + git gutter
  # colored man pages via bat
  export MANPAGER="sh -c 'col -bx | bat -l man -p'"
  export MANROFFOPT="-c"
fi

# ── btop : the pretty system monitor ─────────────────────────────────────────
if (( $+commands[btop] )); then
  alias top='btop'
  alias htop='btop'
  alias mon='btop'
fi

# ── dust : disk usage tree (du) ──────────────────────────────────────────────
if (( $+commands[dust] )); then
  alias du='dust'
  alias dud='dust -d 1'         # one level deep
  alias dus='command du -sh'    # classic summary when you need bytes
fi

# ── duf : disk free, tabular (df) ────────────────────────────────────────────
if (( $+commands[duf] )); then
  alias df='duf'
  alias dff='duf --only local'
fi

# ── procs : modern ps, tree + search ─────────────────────────────────────────
if (( $+commands[procs] )); then
  alias ps='procs'
  alias pst='procs --tree'
  psg() { procs "$@" }         # procs <name> already filters
fi

# ── onefetch : repo fetch card (run inside a git repo) ───────────────────────
if (( $+commands[onefetch] )); then
  alias of='onefetch'
  alias ofa='onefetch --no-art'
fi

# ── hyperfine : command benchmarking ─────────────────────────────────────────
if (( $+commands[hyperfine] )); then
  alias bench='hyperfine'
  alias bench3='hyperfine --warmup 3'
fi

# ── tldr (tealdeer) : fast community man-page examples ────────────────────────
if (( $+commands[tldr] )); then
  alias help='tldr'
  # `??` is a fast way to ask "how do I use X"
  alias '?'='tldr'
fi

# ── git delta : better diffs (config lives in ~/.gitconfig) ──────────────────
# `dlog`/`dshow` force delta even when piped, handy in scripts.
if (( $+commands[delta] )); then
  alias gdd='git diff'                          # already delta via gitconfig
  alias gds='git diff --staged'
fi

# ── terminal toys ────────────────────────────────────────────────────────────
(( $+commands[cbonsai] )) && alias bonsai='cbonsai -l -i -t 0.03'
(( $+commands[cmatrix] )) && alias matrix='cmatrix -b -u 4'
# `rain`/`ring` already exist as crossfetch modes via `cross`.