Skip to main content

Manage browser settings as dotfiles. Currently supports Brave keyboard shortcuts and general settings (non-MAC keys); designed to expand.

Project description

dotbrowser

CI PyPI Python

Manage your browser as a dotfile. Keep Brave shortcuts and UI tweaks in a single TOML, apply with one command, sync across machines — no browser cloud sync required.

Status: alpha. Brave on Linux + macOS — keyboard shortcuts and general settings (vertical tabs, sidebar, NTP & toolbar declutter, …). Architecture is designed to grow to other browsers.

Quick start

The repo ships an opinionated examples/brave.toml: vertical tabs collapsed to icons, decluttered new tab page, stripped-down toolbar, vim-style hjkl shortcuts.

Brave with the minimal config — empty new tab page, vertical tabs collapsed to icons, decluttered toolbar

No clone, no install — apply accepts a URL directly. Fetched payloads are echoed with byte size + SHA-256 so you can see exactly what's being applied:

uvx dotbrowser brave apply --dry-run \
  https://raw.githubusercontent.com/xom11/dotbrowser/main/examples/brave.toml

# Apply (SIGKILLs Brave + restarts)
uvx dotbrowser brave apply -k \
  https://raw.githubusercontent.com/xom11/dotbrowser/main/examples/brave.toml

Prefer to inspect / customise locally first? Download then apply:

curl -fsSL -o brave.toml https://raw.githubusercontent.com/xom11/dotbrowser/main/examples/brave.toml
# edit brave.toml ...
uvx dotbrowser brave apply brave.toml -k

Anything you later remove from brave.toml reverts to Brave's default on the next apply — no orphan entries.

Install

pipx install dotbrowser     # global, isolated venv
uvx dotbrowser <args>       # run on demand, no install step
pip install dotbrowser      # into the active environment

Pin a version: pipx install "dotbrowser>=0.3,<0.4". Run a specific tag: uvx --from 'dotbrowser==0.3.0' dotbrowser <args>. Run from a branch: uvx --from git+https://github.com/xom11/dotbrowser dotbrowser <args>. Local dev: pip install -e ".[test]".

Build your own config

brave.toml carries [shortcuts] and [settings]. One apply writes both in a single backup + write cycle.

# brave.toml
[shortcuts]
toggle_sidebar = ["Control+Shift+KeyE"]
toggle_ai_chat = ["Alt+KeyA"]

# vim-style hjkl
back                = ["Alt+KeyH"]
forward             = ["Alt+KeyL"]
select_previous_tab = ["Alt+KeyJ"]
select_next_tab     = ["Alt+KeyK"]

# Same chord on both OSes — Meta+ = Cmd on macOS, Super on Linux (auto-translated)
new_tab   = ["Control+KeyT", "Meta+KeyT"]
close_tab = ["Control+KeyW", "Meta+KeyW"]

[settings]
"brave.tabs.vertical_tabs_enabled"   = true
"brave.tabs.vertical_tabs_collapsed" = true
"bookmark_bar.show_on_all_tabs"      = false
dotbrowser brave apply brave.toml --dry-run    # preview the diff
dotbrowser brave apply brave.toml -k           # apply, SIGKILL + restart Brave
  • Shortcut keys: Chromium KeyEvent codes joined by +Control+Shift+KeyP, Alt+Digit1, F11.
  • Setting keys: dotted paths into the profile Preferences JSON.
  • Empty [settings] header (no entries) wipes everything dotbrowser previously managed in that namespace. Missing header = skip the namespace entirely.

CLI reference

Shape: dotbrowser <browser> [browser-flags] <action> [action-flags] [args].

Browser-level flags (dotbrowser brave …)

These apply to every action under brave and go before the action name.

Flag Default What it does
-r, --profile-root PATH Linux: ~/.config/BraveSoftware/Brave-Browser
macOS: ~/Library/Application Support/BraveSoftware/Brave-Browser
Brave's root profile directory. Required on Windows / unsupported platforms.
-p, --profile NAME Default Profile directory name inside the root — e.g. "Profile 1", Default.
# Apply on a non-default profile, with an alternate root.
dotbrowser brave -r /custom/path -p "Profile 1" apply brave.toml

apply <config> — write [shortcuts] + [settings]

<config> is a local TOML file path or an http:///https:// URL. URLs are fetched in-memory; the URL, byte size, and SHA-256 are printed before the diff so you can verify exactly what's about to be applied.

Flag What it does
-n, --dry-run Compute + print the diff. Do not back up, write, or touch state files.
-k, --kill-browser If Brave is running, SIGKILL it, apply, then restart via the OS-correct launcher (brave-browser wrapper on Linux, open -a "Brave Browser" on macOS). Without this flag, dotbrowser refuses to run while Brave is open.
dotbrowser brave apply brave.toml --dry-run
dotbrowser brave apply brave.toml -k
dotbrowser brave apply -k https://raw.githubusercontent.com/xom11/dotbrowser/main/examples/brave.toml

shortcuts dump — emit current shortcuts as TOML

By default, only user-customised bindings are emitted (a useful starting point for your own config).

Flag What it does
-a, --all Dump every binding, including Brave's compiled-in defaults.
-o, --output FILE Write to FILE instead of stdout.
dotbrowser brave shortcuts dump                       # what am I overriding?
dotbrowser brave shortcuts dump -a -o all-binds.toml  # full reference dump

shortcuts list [filter] — search known command names

Lists every command id you can bind to. The optional positional filter is a substring match.

dotbrowser brave shortcuts list toggle   # everything containing "toggle"
dotbrowser brave shortcuts list          # full list

settings dump [keys ...] — inspect setting values

  • No keys → dumps every setting dotbrowser is currently managing on this profile.
  • Explicit keys → dumps those dotted paths. Missing keys appear as commented-out lines so you know dotbrowser looked.
Flag What it does
-o, --output FILE Write to FILE instead of stdout.
dotbrowser brave settings dump
dotbrowser brave settings dump brave.tabs.vertical_tabs_enabled bookmark_bar.show_on_all_tabs

How it works

dotbrowser patches Brave's profile Preferences JSON directly. It refuses to run while Brave is open (Brave overwrites the file on exit) — -k is the escape hatch: SIGKILL Brave, apply, restart. Each apply takes one timestamped backup, writes atomically (temp file + rename), and verifies the result by reloading.

Managed entries are tracked per namespace in sidecar files (Preferences.dotbrowser.{shortcuts,settings}.json), so removing a key from your config restores Brave's default on the next apply.

Default profile root: ~/.config/BraveSoftware/Brave-Browser on Linux, ~/Library/Application Support/BraveSoftware/Brave-Browser on macOS. Override with -r/--profile-root.

Caveats

  • Brave Sync can overwrite [settings] entries on its next pulse if they fall in a synced category. UI-layout keys like brave.tabs.vertical_tabs_* are local-only and immune.
  • Linux + macOS only. Windows needs a custom --profile-root and process-management path.
  • Brave only. Chrome hardcodes shortcuts (no UI to customize), so this approach doesn't apply.
  • A handful of settings (homepage, default search engine, pinned_tabs, …) are integrity-protected and can't be patched yet — dotbrowser refuses them with a clear error rather than letting the change silently disappear on next launch. Set those via the Brave UI for now.

Roadmap

Open items live in TODO.md: expanded settings coverage (homepage / default search / pinned tabs), settings catalog generator, Windows support, more browsers (Vivaldi, Edge, Arc, Firefox).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dotbrowser-0.3.1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dotbrowser-0.3.1-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file dotbrowser-0.3.1.tar.gz.

File metadata

  • Download URL: dotbrowser-0.3.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dotbrowser-0.3.1.tar.gz
Algorithm Hash digest
SHA256 4abb6e6959731210938070757d03857dadf12e075cebc7e60bda1f33286e3c53
MD5 0da15e6da3c56440e183a9a81375759d
BLAKE2b-256 5da1a6c1ae24eccdfa328ac70998b64a264a7a370c36802bae15fccf3eb414c5

See more details on using hashes here.

File details

Details for the file dotbrowser-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: dotbrowser-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for dotbrowser-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91f7f652a1edb858824446954653d67bdcf22683de70b53122f32bc663e33fcd
MD5 6f827ed4f4c54b9d11546d12e0933fdd
BLAKE2b-256 f628266ceb1eb8a927441222f20111b148b85133c07ba890998aed3749a0ac20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page