- Python 52.4%
- Shell 15.3%
- HTML 14.9%
- JavaScript 5.9%
- TypeScript 5.8%
- Other 5.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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. |
||
| .agents | ||
| .config | ||
| .git-filters | ||
| .local | ||
| .pi | ||
| .var/app/com.obsproject.Studio/config/obs-studio | ||
| docs | ||
| obs | ||
| python_utils | ||
| scripts | ||
| .bash_profile | ||
| .bashrc | ||
| .env.example | ||
| .gitattributes | ||
| .gitconfig | ||
| .gitignore | ||
| .python-version | ||
| .stow-local-ignore | ||
| .stowrc | ||
| init.sh | ||
| justfile | ||
| LICENSE.md | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
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:
.stowrcsets--no-folding, so stow creates real directories in$HOMEand links one file at a time..stow-local-ignoreexcludes repo tooling and runtime paths. It is a list of anchored Perl regexes — an unanchored.envalso matches.config/environment.d/cursor.conf, andobs/*matches any path containingobs, which silently leaves real config files unlinked from$HOME..gitignorerepeats the runtime paths as a backstop, so machine state cannot be committed even while it is still sitting in the working tree.just dotfiles-checkfails if a home tree is folded again or if untracked files reappear inside the repo.scripts/unfold-dotfiles.shmigrates 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 (--applyexecutes) 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;--forceoverrides the refusal. The check matches executables, not command-line substrings, becausepgrep -f pialso matches[irq/9-acpi],[napi/wt0-0]andpipewire.
Window Manager (Niri)
This config uses Niri with the following utilities:
- brightnessctl, playerctl, and wireplumber for brightness and media keys and sound.
- Gnome Polkit for authentication
- grim, swappy, and slurp for screenshots.
- Mako for notifications
- Nautilus as a file manager.
- Noto Fonts and Nerd Fonts for fonts
- nwg-look for managing themes.
- Catppuccin as the main color scheme
- cursors
- GTK Theme
- polkit-gnome for polkit
- rofi, rofi-calc, and cliphist as an application launcher and clipboard manager.
- swaybg for background
- Waybar for status bar
- Looking at switching to ewww or a Quickshell-based solution
- wl-clipboard for clipboard history
Terminal Utilities
This config uses ghostty with the following utilities:
- bat
- delta
- difftatic
- fd as a
findreplacement. - fzf as a fuzzy finder.
- kakoune with kak-tree-sitter and kakoune-lsp as a text editor.
- nvm
- OpenCode for agentic coding.
- ripgrep as a
grepreplacement. - tldr for more readable manpages.
- wiremix for volume control.
- zellij as a terminal multiplexer.
- zoxide as a
cdreplacement.
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.
Emoji search
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.