My personal dotfiles
  • Python 52.4%
  • Shell 15.3%
  • HTML 14.9%
  • JavaScript 5.9%
  • TypeScript 5.8%
  • Other 5.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
BlackHat-Magic 3b22fe1cbf feat/pi: run the browser MCP through codemode
With every server on `codemode`, nothing is declared until a script calls it and
all of them are reachable from one sandbox. A single script now drives the
browser, fetches a page through Exa, and searches Cloudflare docs together.

The browser was `direct` because RPC sessions cannot use `tool_search`; that
reason does not apply to `codemode`, which works there. Snapshots also benefit:
their output is capped by the script's `max_output_tokens` instead of being
declared tool output.

Document the exposure choices that put several servers in one sandbox, the
hybrid `toolExposure` option for a hot tool, and the per-thread exclusion lever.
2026-11-17 03:30:11 -08:00
.agents pi: remove planning skill, update defaults 2026-10-15 18:10:51 -07:00
.config Merge remote-tracking branch 'silverquill/master' into chore/fleet-dotfiles-sync 2026-11-05 00:05:26 -08:00
.git-filters fix/git: fail closed while preserving local dotfile credentials (#3) 2026-11-05 14:24:06 +00:00
.local Merge remote-tracking branch 'silverquill/master' into chore/fleet-dotfiles-sync 2026-11-05 00:05:26 -08:00
.pi feat/pi: run the browser MCP through codemode 2026-11-17 03:30:11 -08:00
.var/app/com.obsproject.Studio/config/obs-studio feat/obs: save Witherbloom PipeWire capture scene 2026-11-05 00:06:51 -08:00
docs feat/pi: run the browser MCP through codemode 2026-11-17 03:30:11 -08:00
obs obs: starting soon, brb, ending stream scenes 2026-03-18 06:03:51 -07:00
python_utils fix/cuid: correct base encoding, ID text, rtime and format output 2026-11-06 19:21:45 -08:00
scripts fix/git: fail closed while preserving local dotfile credentials (#3) 2026-11-05 14:24:06 +00:00
.bash_profile first commit 2026-02-25 23:21:04 -08:00
.bashrc feat/bashrc: prepend user@host 2026-10-10 00:41:33 -07:00
.env.example opencode: API keys properly(?) redacted; add configs to repo 2026-05-21 01:22:21 -07:00
.gitattributes fix/git: fail closed while preserving local dotfile credentials (#3) 2026-11-05 14:24:06 +00:00
.gitconfig fix/git: fail closed while preserving local dotfile credentials (#3) 2026-11-05 14:24:06 +00:00
.gitignore refactor(dotfiles): move Pi Web ownership to Pi-Web and Fleet 2026-10-23 22:26:09 -07:00
.python-version bgfx: initialize uv project 2026-03-03 15:00:16 -08:00
.stow-local-ignore refactor(dotfiles): move Pi Web ownership to Pi-Web and Fleet 2026-10-23 22:26:09 -07:00
.stowrc fix(dotfiles): stop stowing machine state into the repository 2026-10-13 20:48:49 -07:00
init.sh justfile: dont fail on install nothing 2026-05-26 22:15:08 -07:00
justfile refactor(dotfiles): move Pi Web ownership to Pi-Web and Fleet 2026-10-23 22:26:09 -07:00
LICENSE.md initial superfile, cliphist config 2026-02-26 18:08:13 -08:00
pyproject.toml utils: add ty and ruff to cli utils 2026-05-17 20:11:57 -07:00
README.md feat/pi: run the browser MCP through codemode 2026-11-17 03:30:11 -08:00
uv.lock feat/rofi: add hybrid emoji search with system Ollama 2026-10-10 00:48:03 -07:00

Dotfiles

Requires the following arch packages:

sudo pacman -S brightnessctl cliphist fd flatpak fzf ghostty grim mako nwg-look \
    rofi rofi-calc slurp swappy ttf-nerd-fonts ttf-nerd-fonts-common zoxide \
    ttf-nerd-fonts-mono waybar ollama

Requires the following AUR packages:

paru -S catppuccin-cursors-mocha catppuccin-gtk-theme-mocha rofi-blocks-git

The following mise utilities:

mise use -g node@latest uv@latest opencode@latest bun@latest hadolint@latest cargo:bat@latest cargo:fd-find@latest cargo:ripgrep@latest cargo:git-delta@latest cargo:difftastic@latest cargo:zellij@latest zoxide@latest fzf@latest

Requires the following flatpak packages:

flatpak install org.mozilla.firefox

Installation with GNU stow:

cd
git clone git@github.com:BlackHat-Magic/dotfiles
cd dotfiles
stow --no-folding .   # .stowrc already requests this
just dotfiles-check   # verify the layout below

Safe Git tracking of local configuration

Run python3 scripts/dotfiles-secrets.py install once in each clone (and again when updating this tool). It captures existing OBS/OpenCode/Pi credential fields without rewriting live files, installs required Git filters, and adds pre-commit/pre-push safety checks. Ordinary git add, commit and push then work normally. Existing unrelated hooks are never replaced; installation refuses if a pre-commit or pre-push hook needs manual integration. Other hooks remain untouched. The installed tool lives in Git's common directory so branch changes cannot remove it. Before installation, the stowed global configuration requires clean filtering but passes checkout content through unchanged, allowing a fresh clone to finish. Run the installer before editing or switching credential-bearing files; only installed local smudge filters restore private values.

OBS WebSocket passwords, OpenCode headers and credential-shaped string fields in Pi settings are committed as CHANGEME. Their values live only in ~/.local/state/dotfiles-secrets/values.json (directory0700/file0600), under a file lock. Checkouts restore those values; a new machine without that private store gets placeholders. No .env is sourced. JSONC comments and trailing commas are normalized to JSON by the filters. A parsing/storage/filter failure aborts git add, rather than silently committing raw input. Live credentials are not printed in failures. Keep the private store backed up privately; do not copy it into this repository.

The hooks reject unsanitized tracked credential fields, known local credential values of at least12 bytes copied into another file, common provider/private-key patterns, and selected runtime credential files. Push checks inspect intermediate outgoing commits, not only the final tree. This is a backstop, not a complete secret scanner: unknown credential formats, short credentials copied outside protected fields, intentional hook bypasses and unrecognized file types still need judgment. The script does not rewrite existing history. Provider tokens belong in the private provider token file, not provider-proxy.conf.

Layout: configuration, not machine state

This repository tracks configuration, and $HOME points at it. That only works if stow links files. Stow's default folds a whole directory into a single symlink (~/.config -> ~/.dotfiles/.config), which makes the repo the live storage for everything those programs write: mise toolchains (1.8GB on this machine), pi sessions, caches, tokens, tmp files. They then appear as untracked files in the working tree, and one git add -A can commit them while one git clean -fdx can destroy them.

The policy here is:

  • .stowrc sets --no-folding, so stow creates real directories in $HOME and links one file at a time.
  • .stow-local-ignore excludes repo tooling and runtime paths. It is a list of anchored Perl regexes — an unanchored .env also matches .config/environment.d/cursor.conf, and obs/* matches any path containing obs, which silently leaves real config files unlinked from $HOME.
  • .gitignore repeats the runtime paths as a backstop, so machine state cannot be committed even while it is still sitting in the working tree.
  • just dotfiles-check fails if a home tree is folded again or if untracked files reappear inside the repo.
  • scripts/unfold-dotfiles.sh migrates an already-folded machine: it replaces the tree symlinks with real directories, moves the runtime entries back to $HOME, and re-links the tracked configuration. It is a dry run by default (--apply executes) and refuses while a pi agent, the pi-web service, Zellij, OBS or Chromium is using those paths, since session files, locks and tokens live there. It names each holder by pid and command line; --force overrides the refusal. The check matches executables, not command-line substrings, because pgrep -f pi also matches [irq/9-acpi], [napi/wt0-0] and pipewire.

Window Manager (Niri)

This config uses Niri with the following utilities:

Terminal Utilities

This config uses ghostty with the following utilities:

Pi web workspace

The private Pi browser workspace is maintained in Pi-Web. See that repository for app features, development, and usage; deployment and service management live in Fleet, not this dotfiles repository.

Proton Mail Bridge over NetBird

protonmail-bridge.service runs the headless bridge (Arch protonmail-bridge-core) as a user service; it stores the account credential in the login keyring, which gnome-keyring-daemon.service unlocks at startup from ~/.local/state/protonmail-bridge/keyring-password (0600) — a headless session has no PAM login to unlock it otherwise, and without that unlock Bridge reports "no keychain". Bridge listens on loopback only; protonmail-imap and protonmail-smtp socket units forward 100.82.163.18:1143 and :1025 to it through systemd-socket-proxyd, so only NetBird devices can reach them.

Mail clients use the Proton address as the username and the per-account bridge password (protonmail-bridge-core --cli → info), with STARTTLS and Proton's self-signed certificate (openssl s_client -starttls imap -connect 127.0.0.1:1143 | openssl x509 -noout -fingerprint -sha256). To add or remove an account, stop protonmail-bridge.service first — a second instance cannot take the lock — then run the CLI with DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus, login/logout, quit, and start the service again.

MCP servers and codemode

mcp.json declares every MCP server directly, with no adapter packages: the browser (above), Exa, the Cloudflare API server, and Cloudflare documentation. codemode is on by default ("defaultTools": ["+codemode"]).

Server URL Exposure Tools
browser local browser-mcp serve codemode 25
exa https://mcp.exa.ai/mcp?tools=web_search_exa,web_fetch_exa,web_search_advanced_exa codemode 3, keyless
exa-agent https://mcp.exa.ai/mcp?tools=agent_run codemode 1, needs OAuth
cloudflare https://mcp.cloudflare.com/mcp codemode search, execute, docs, whoami
cloudflare-docs https://docs.mcp.cloudflare.com/mcp codemode 2

Exa is the hosted MCP rather than npm:pi-exa: the adapter wrapped the same tools in a package, left Exa Agent out, and bypassed Pi's MCP result guard. The tools parameter replaces Exa's defaults, so each entry names exactly what it should expose — that keeps exa keyless while exa-agent asks for sign-in separately. Exa returns markdown text, not JSON, and web_search_exa requires an objective.

Cloudflare is the official API MCP (mcp.cloudflare.com) plus the official docs server, not the per-product adapters. search and execute are Code Mode: both take { code } and run against the OpenAPI spec or cloudflare.request() in a Dynamic Worker sandbox, covering ~2,500 endpoints in about 1,000 tokens. Sign in once with /mcp login cloudflare; cloudflare-docs needs no auth. Tokens stay in ~/.pi/agent/mcp-auth.json.

Every server, the browser included, uses codemode, so one script can drive the browser, fetch through Exa, and query Cloudflare docs together; no server is declared until a script uses it. codemode exposure keeps these tools out of the model's declared tool list — scripts reach them as tools.mcp__exa__web_search_exa(...), tools.mcp__cloudflare_api__search(...) and so on — so adding servers costs no context until a script uses them. RPC sessions (the Pi web UI) can use them because codemode is a tool, unlike deferred exposure which needs tool_search. See MCP servers in codemode for the script API, cross-server patterns, and what each mechanism costs.

Browser-use MCP

mcp.json registers a browser server running ~/.local/bin/browser-mcp serve, which is @playwright/mcp (pinned 0.0.83, installed offline under ~/.local/share/browser-mcp) driving the system /usr/bin/chromium. It is adapted rather than reimplemented because Playwright's accessibility snapshots need no vision model and it already ships the browser plumbing a hand-rolled server would have to grow; the wrapper adds the machine fit: a pinned install instead of npx on every session, the system Chromium instead of a second downloaded build, and state under ~/.local/state/browser-mcp (0700) so profiles, screenshots and console logs never land in this repo. It runs headless by default.

Chromium's user-data-dir takes an exclusive lock, and every pi process starts its own MCP server, so one shared profile lets only the first session drive the browser — the rest fail with "Browser is already in use". Each server therefore gets its own profile under profiles/ (stale ones pruned after a day). Site sign-ins are consequently per browser session; set BROWSER_MCP_PROFILE_KEY to a fixed string to share one profile deliberately, at the cost of running only one browser at a time.

browser-mcp setup reinstalls/upgrades the pinned host; browser-mcp version and browser-mcp chromium report what would run. Environment: BROWSER_MCP_HEADED=1 (needs a display), BROWSER_MCP_ISOLATED=1 (in-memory profile, no saved sign-ins), BROWSER_MCP_CHROMIUM, BROWSER_MCP_VIEWPORT, BROWSER_MCP_NO_SANDBOX=1 (only if Chromium cannot start). It is registered with "exposure": "direct", because RPC sessions never activate tool_search and deferred tools would be uncallable there. The 25 tools cover navigation, snapshots, clicking/typing, forms, uploads and downloads, dialogs, tabs, console and network inspection, evaluation, screenshots and tracing.

The browser is a real capability with network access and a saved profile: it is listed in the manage panel as a global file server, so a thread that should not have it can untick This thread, and BROWSER_MCP_ISOLATED=1 removes saved sign-ins entirely. Existing sessions pick the server up when their agent starts again.

Mod+Period opens the Rofi emoji picker. It uses the system ollama package and service, not mise or a separate user inference server. After stow . and installing rofi-blocks-git, enable the system service if it is not already running, then install the search tool, model and index:

sudo systemctl enable --now ollama.service # or doas; only needed once
just emoji-setup

The system service starts at boot and is the only inference server needed. The setup recipe requires it to be running on 127.0.0.1:11434; it does not launch another server or change the service configuration. Model downloads are managed by the system service in its own model store, while the search index belongs to your desktop user. Existing models are left untouched.

The small python_utils/emoji_search uv tool sends fzf matches immediately, then waits for 350 ms of idle typing before embedding the query. Rofi's blocks plugin updates the same window with fused fuzzy/cosine-similarity results; obsolete queries never replace newer results and inference is serialized. Without fzf, a Python subsequence matcher is used. Missing Ollama/model/index leaves fuzzy search working; without the plugin/tool, the launcher falls back to ordinary Rofi fuzzy matching. After Rofi upgrades, rebuild rofi-blocks-git if its ABI no longer matches.

This uses Qwen3-Embedding-0.6B, not the qwen3:0.6b chat model. The official Ollama 0.6B embedding tag is Q8 (~639 MB on disk), not Q4. Search requests use CPU inference with at most four threads and a 512-token context. The model is loaded on demand and unloaded after 15 seconds idle; the server stays running but does not keep model weights warmed indefinitely. Cold searches may take longer while fuzzy results remain available. Change the keep-alive/CPU options in emoji_search.py if you prefer different tradeoffs.

Indexing is an explicit one-time operation (it can take several minutes on CPU), not work done when opening the picker. Normalized 256-dimensional text embeddings live in $XDG_CACHE_HOME/emoji-search/vectors.sqlite3 (default ~/.cache). Indexing resumes after interruptions and invalidates entries when their description or model digest changes. No QMD, vector database server, image model or chat generation is needed. Queries stay on localhost.

The generated .config/rofi/emoji.txt contains three tab-separated fields: emoji, official Unicode character name (or Unicode's Emoji sequence name), and description. Descriptions retain the previous names/keywords, CLDR aliases, and curated colloquial/contextual meanings—including ironic and unintended uses—from .config/rofi/emoji-descriptions.json. Skin-tone variants inherit contextual descriptions. Refresh the pinned Unicode 17.0 / CLDR 48.2 data and re-index after editing descriptions:

python .config/rofi/generate-emoji-list.py --cache-dir .config/rofi/emoji-source
emoji-search index

Useful maintenance commands:

systemctl status ollama.service
journalctl -u ollama.service
uv run --package emoji-search emoji-search index --corpus .config/rofi/emoji.txt
uv run --package emoji-search python -m unittest discover -s python_utils/emoji_search/tests

To remove semantic emoji search: uv tool uninstall emoji-search. The original fuzzy picker remains usable, and the system Ollama service is left available for other tools.

Provider proxy

provider-proxy is a small Bun service (port 8085) that gives Pi one proxy provider across your subscriptions and API keys: OpenAI/ChatGPT subscription first, then OpenCode Go subscription, Ollama Cloud subscription, OpenCode Zen pay-as-you-go, and OpenRouter pay-as-you-go. Tiers that don't serve a model are skipped; a tier that reports a usage limit is skipped for that request and cooled down briefly. Token usage is aggregated in SQLite and the web UI toggles which models appear in Pi's /model picker. ChatGPT auth is reused from Pi's own OpenAI login on the proxy host; the OpenCode/Ollama/ OpenRouter keys are entered in the web UI or during setup.

Pi on the proxy host uses plain HTTP loopback (http://127.0.0.1:8085). Browsers use https://<netbird-host>:8085 (browsers default to https) with a setup-generated self-signed certificate; verify its fingerprint before trusting it. The service binds loopback plus the NetBird address only.

just provider-proxy-setup       # deploy, create token/config/cert, enable service
provider-proxy token            # bearer token for Pi + browser

The proxy provider adapter lives with the service, in the Provider-Proxy repository's pi/ directory, and is installed into Pi's package directory:

cd ~/Projects/Provider-Proxy/master && bun run install-pi

Pi on the proxy host needs no environment configuration at all: the adapter reads ~/.local/state/provider-proxy/token itself and defaults to http://127.0.0.1:8085. From another machine set PROVIDER_PROXY_URL and PROVIDER_PROXY_API_KEY (see .config/environment.d/provider-proxy.conf; that file is tracked as an empty template, so never commit a filled key) and pick proxy/<model> with /model. /proxy shows tier health and today's usage. just provider-proxy-check runs the service tests and typecheck.

Python Utilities

This repo contains a bunch of small Python CLI utilities that perform simple tasks that I find useful.

Posterize

A simple Python utility that posterizes a given image and applies any one of a number of dithering algorithms.


# from the project root
uv run posterize [-o OUTPUT] image		# to run without installing
uv tool install python_utils/posterize	# install to current user's PATH
uv tool uninstall posterize				# to uninstall

# over the internet (without cloning repository)
uvx --from git+https://github.com/BlackHat-Magic/dotfiles posterize [-o OUTPUT] image		# run w/o install
uv tool install git+github.com/BlackHat-magic/dotfiles --directory python_utils/posterize	# install to user's PATH
uv tool uninstall posterize																	# uninstall

OBS Studio

This repo also contains my configurations for OBS Studio.

Plugins

It expects these plugins to be installed. com.obsproject.Studio.Plugin. is omitted from the start of the flatpak application IDs for brevity.

Plugin Name Flatpak Application ID Arch/AUR Package
Advanced Masks AdvancedMasks obs-advanced-masks (AUR)
Aitum Multistream AitumMultistream obs-aitum-multistream-bin (AUR)
Move Transition MoveTransition obs-move-transition (AUR) (Out of date)
Scale To Sound ScaleToSound obs-scale-to-sound (AUR)
Shaderfiler Shaderfilter obs-shaderfilter-git (AUR)
Source Record SourceRecord obs-source-record (AUR)
Stroke Glow Shadow StrokeGlowShadow obs-stroke-glow-shadow (AUR)
Transition Table TransitionTable obs-transition-table (AUR)
Wayland Hotkeys WaylandHotkeys obs-wayland-hotkeys-git (AUR)
3D Effect _3DEffect obs-3d-effect (AUR)
Waveform waveform N/A

TODO

  • Icons that don't suck

Acknowledgements

  • OBS "Starting Soon," "Be Right Back," and "Ending Stream" screens use a shader based on Base warp fBM cineshader by TrinketMage on ShaderToy.