docs(readme): add comprehensive controls section and update install instructions
- commit
- fe50633ef9d59043db46bfa12bcdd9d2cb39ab9b
- author
- bamen · · 2025-09-09 18:40 UTC
- committer
- bamen · · 2025-09-09 18:13 UTC
- parent
- cf590d6
- signature
- unsigned
1 file · +166 -43
M README.md +166 -43
| @@ -22,41 +22,76 @@ Dumber is a minimalist browser and launcher companion focused on speed and simpl | |||
| 22 | 22 | ## Features | |
| 23 | 23 | - Built‑in browser window (no external browser needed) | |
| 24 | 24 | - Custom `dumb://` scheme serving embedded frontend assets | |
| 25 | - | - Keyboard shortcuts: DevTools (F12), Omnibox toggle (Ctrl/Cmd+L), Zoom In/Out/Reset | |
| 25 | + | - Keyboard and mouse controls: comprehensive shortcuts and gestures | |
| 26 | 26 | - Persistent history with search and stats | |
| 27 | 27 | - Per‑domain zoom persistence | |
| 28 | 28 | - dmenu‑style launcher integration (rofi, fuzzel) with history and shortcut suggestions | |
| 29 | 29 | ||
| 30 | + | ## Controls & Shortcuts | |
| 31 | + | ||
| 32 | + | ### Keyboard Shortcuts | |
| 33 | + | | Shortcut | Action | Notes | | |
| 34 | + | |----------|--------|-------| | |
| 35 | + | | **F12** | Open Developer Tools | WebKit inspector | | |
| 36 | + | | **Ctrl/Cmd+L** | Open Omnibox | URL/search input with history | | |
| 37 | + | | **Ctrl/Cmd+F** | Find in Page | Search text within current page | | |
| 38 | + | | **Ctrl/Cmd+=** | Zoom In | Firefox-compatible zoom levels | | |
| 39 | + | | **Ctrl/Cmd++** | Zoom In | Alternative plus key | | |
| 40 | + | | **Ctrl/Cmd+-** | Zoom Out | Works across keyboard layouts | | |
| 41 | + | | **Ctrl/Cmd+0** | Reset Zoom | Return to 100% zoom | | |
| 42 | + | | **Alt+←** | Navigate Back | Go to previous page | | |
| 43 | + | | **Alt+→** | Navigate Forward | Go to next page | | |
| 44 | + | ||
| 45 | + | ### Mouse Controls | |
| 46 | + | | Action | Result | Notes | | |
| 47 | + | |--------|---------|-------| | |
| 48 | + | | **Ctrl+Scroll Up** | Zoom In | Smooth zoom control | | |
| 49 | + | | **Ctrl+Scroll Down** | Zoom Out | Smooth zoom control | | |
| 50 | + | | **Mouse Button 8** | Navigate Back | Side button (back) | | |
| 51 | + | | **Mouse Button 9** | Navigate Forward | Side button (forward) | | |
| 52 | + | | **Two-finger Swipe** | Back/Forward | When supported by touchpad | | |
| 53 | + | ||
| 54 | + | ### Omnibox/Find Mode (when active) | |
| 55 | + | | Shortcut | Action | Notes | | |
| 56 | + | |----------|--------|-------| | |
| 57 | + | | **Escape** | Close overlay | Exit omnibox or find mode | | |
| 58 | + | | **Enter** | Execute/Navigate | Navigate to URL or jump to match | | |
| 59 | + | | **Shift+Enter** | Previous Match | Find mode: go to previous match | | |
| 60 | + | | **Alt+Enter** | Center Match | Find mode: center on match, keep open | | |
| 61 | + | | **↑/↓ Arrow** | Navigate Results | Browse suggestions/matches | | |
| 62 | + | ||
| 63 | + | All zoom changes are automatically persisted per-domain and restored on next visit. | |
| 64 | + | ||
| 30 | 65 | ## Quick Start | |
| 31 | 66 | Prerequisites: | |
| 32 | 67 | - Go 1.25+ | |
| 33 | - | - Node.js 20+ (for building the embedded frontend) | |
| 68 | + | - Node.js 20+ and npm (for building the embedded TypeScript frontend) | |
| 34 | 69 | - For GUI build: WebKitGTK 6 and GTK4 dev packages (examples) | |
| 35 | 70 | - Debian/Ubuntu: `libwebkitgtk-6.0-dev libgtk-4-dev build-essential` | |
| 36 | 71 | - Arch: `webkitgtk-6.0 gtk4 base-devel` | |
| 37 | 72 | ||
| 38 | 73 | Build options: | |
| 39 | - | - GUI (recommended): | |
| 40 | - | - `make build-gui` # builds with `-tags=webkit_cgo` | |
| 74 | + | - GUI (default, recommended): | |
| 75 | + | - `make build` # builds frontend + Go with `-tags=webkit_cgo` | |
| 41 | 76 | - Run: `./dist/dumber` # opens the embedded homepage | |
| 42 | 77 | - CLI‑only (no GUI, CGO disabled): | |
| 43 | - | - `make build-static` | |
| 44 | - | - Run: `./dist/dumber-static version` | |
| 45 | - | - Full build pipeline (frontend + Go): | |
| 46 | - | - `make build` | |
| 78 | + | - `make build-no-gui` | |
| 79 | + | - Run: `./dist/dumber-no-gui version` | |
| 47 | 80 | ||
| 48 | 81 | Development: | |
| 49 | 82 | - `make dev` runs `go run .` (non‑CGO; GUI stubs log to console) | |
| 50 | 83 | - `make test` runs tests; `make lint` runs golangci‑lint | |
| 51 | 84 | ||
| 52 | 85 | ## Install | |
| 86 | + | **Note**: `go install` will not work for this project because the frontend assets must be built first and embedded into the binary. Use the build commands instead: | |
| 87 | + | ||
| 88 | + | - GUI build (default, recommended): | |
| 89 | + | - Ensure WebKit2GTK/GTK dev packages are installed (see prerequisites) | |
| 90 | + | - Clone the repo and run `make build` (builds frontend first, then Go with GUI support) | |
| 91 | + | - The resulting `./dist/dumber` binary includes the native GUI window | |
| 53 | 92 | - CLI‑only (no native window): | |
| 54 | - | - `go install github.com/bnema/dumber@latest` | |
| 55 | - | - Useful everywhere; runs the CLI and non‑CGO flows. In this mode the GUI code is stubbed (no native window shown). | |
| 56 | - | - GUI build (Wayland + WebKit2GTK via CGO): | |
| 57 | - | - Ensure WebKit2GTK/GTK dev packages are installed (see prerequisites) and CGO is enabled in your environment. | |
| 58 | - | - `go install -tags webkit_cgo github.com/bnema/dumber@latest` | |
| 59 | - | - If pkg‑config can’t find headers, set `PKG_CONFIG_PATH` appropriately or prefer `make build-gui`. | |
| 93 | + | - Clone the repo and run `make build-no-gui` | |
| 94 | + | - The resulting `./dist/dumber-no-gui` binary runs CLI flows with GUI code stubbed | |
| 60 | 95 | ||
| 61 | 96 | ## Usage | |
| 62 | 97 | - Open a URL or search: | |
| @@ -79,34 +114,122 @@ Note: The root flag path only generates options; for processing a selection (`-- | |||
| 79 | 114 | In GUI mode the app serves an embedded homepage via `dumb://homepage`, and frontend assets under `dumb://app/...`. | |
| 80 | 115 | ||
| 81 | 116 | ## Configuration | |
| 117 | + | ||
| 82 | 118 | Dumber follows the XDG Base Directory spec: | |
| 83 | 119 | - Config: `~/.config/dumber/config.json` | |
| 84 | 120 | - Data: `~/.local/share/dumber` | |
| 85 | 121 | - State: `~/.local/state/dumber` (default DB lives here) | |
| 86 | 122 | ||
| 87 | - | A default `config.json` is created on first run. Key fields: | |
| 88 | - | - `database.path`: SQLite database path (defaults to XDG state dir `history.db`) | |
| 89 | - | - `search_shortcuts`: map of search shortcuts, e.g. | |
| 90 | - | ```json | |
| 91 | - | { | |
| 92 | - | "g": { "url": "https://www.google.com/search?q=%s", "description": "Google" }, | |
| 93 | - | "gh": { "url": "https://github.com/search?q=%s", "description": "GitHub" } | |
| 94 | - | } | |
| 95 | - | ``` | |
| 96 | - | - `appearance`: default fonts and base font size for pages without specified fonts | |
| 97 | - | - `dmenu`: options for launcher integration (history count, prefixes, etc.) | |
| 98 | - | ||
| 99 | - | Environment variables use the `DUMB_BROWSER_` prefix (managed by Viper). Examples: | |
| 100 | - | - `DUMB_BROWSER_DATABASE_PATH=...` | |
| 101 | - | - `DUMB_BROWSER_DMENU_MAX_HISTORY_ITEMS=50` | |
| 102 | - | ||
| 103 | - | Config changes are watched and applied at runtime when possible. | |
| 104 | - | ||
| 105 | - | ## Data Model | |
| 106 | - | SQLite tables (created automatically): | |
| 107 | - | - `history(id, url, title, visit_count, last_visited, created_at)` | |
| 108 | - | - `shortcuts(shortcut, url_template, description, created_at)` | |
| 109 | - | - `zoom_levels(domain PRIMARY KEY, zoom_factor, updated_at)` | |
| 123 | + | A default `config.json` is created on first run. Config changes are watched and applied at runtime when possible. | |
| 124 | + | ||
| 125 | + | ### Complete Configuration Reference | |
| 126 | + | ||
| 127 | + | #### Database Configuration | |
| 128 | + | ```json | |
| 129 | + | "database": { | |
| 130 | + | "path": "~/.local/state/dumber/history.db", | |
| 131 | + | "max_connections": 1, | |
| 132 | + | "max_idle_time": "5m0s", | |
| 133 | + | "query_timeout": "30s" | |
| 134 | + | } | |
| 135 | + | ``` | |
| 136 | + | ||
| 137 | + | #### History Management | |
| 138 | + | ```json | |
| 139 | + | "history": { | |
| 140 | + | "max_entries": 10000, | |
| 141 | + | "retention_period_days": 365, | |
| 142 | + | "cleanup_interval_days": 1 | |
| 143 | + | } | |
| 144 | + | ``` | |
| 145 | + | ||
| 146 | + | #### Search Shortcuts | |
| 147 | + | ```json | |
| 148 | + | "search_shortcuts": { | |
| 149 | + | "g": { "url": "https://www.google.com/search?q=%s", "description": "Google search" }, | |
| 150 | + | "gh": { "url": "https://github.com/search?q=%s", "description": "GitHub search" }, | |
| 151 | + | "yt": { "url": "https://www.youtube.com/results?search_query=%s", "description": "YouTube search" }, | |
| 152 | + | "w": { "url": "https://en.wikipedia.org/wiki/%s", "description": "Wikipedia search" }, | |
| 153 | + | "ddg": { "url": "https://duckduckgo.com/?q=%s", "description": "DuckDuckGo search" }, | |
| 154 | + | "so": { "url": "https://stackoverflow.com/search?q=%s", "description": "Stack Overflow search" }, | |
| 155 | + | "r": { "url": "https://www.reddit.com/search?q=%s", "description": "Reddit search" }, | |
| 156 | + | "npm": { "url": "https://www.npmjs.com/search?q=%s", "description": "npm package search" }, | |
| 157 | + | "go": { "url": "https://pkg.go.dev/search?q=%s", "description": "Go package search" }, | |
| 158 | + | "mdn": { "url": "https://developer.mozilla.org/en-US/search?q=%s", "description": "MDN Web Docs search" } | |
| 159 | + | } | |
| 160 | + | ``` | |
| 161 | + | ||
| 162 | + | #### Dmenu Integration | |
| 163 | + | ```json | |
| 164 | + | "dmenu": { | |
| 165 | + | "max_history_items": 20, | |
| 166 | + | "show_visit_count": true, | |
| 167 | + | "show_last_visited": true, | |
| 168 | + | "history_prefix": "🕒", | |
| 169 | + | "shortcut_prefix": "🔍", | |
| 170 | + | "url_prefix": "🌐", | |
| 171 | + | "date_format": "2006-01-02 15:04", | |
| 172 | + | "sort_by_visit_count": true | |
| 173 | + | } | |
| 174 | + | ``` | |
| 175 | + | ||
| 176 | + | #### Logging Configuration | |
| 177 | + | ```json | |
| 178 | + | "logging": { | |
| 179 | + | "level": "info", | |
| 180 | + | "format": "text", | |
| 181 | + | "filename": "", | |
| 182 | + | "max_size": 100, | |
| 183 | + | "max_backups": 3, | |
| 184 | + | "max_age": 7, | |
| 185 | + | "compress": true | |
| 186 | + | } | |
| 187 | + | ``` | |
| 188 | + | ||
| 189 | + | #### Appearance Settings | |
| 190 | + | ```json | |
| 191 | + | "appearance": { | |
| 192 | + | "sans_font": "Fira Sans", | |
| 193 | + | "serif_font": "Fira Sans", | |
| 194 | + | "monospace_font": "Fira Code", | |
| 195 | + | "default_font_size": 16 | |
| 196 | + | } | |
| 197 | + | ``` | |
| 198 | + | ||
| 199 | + | #### Rendering Mode (GPU/CPU) | |
| 200 | + | ```json | |
| 201 | + | "rendering_mode": "auto" | |
| 202 | + | ``` | |
| 203 | + | - `auto`: Detect GPU availability and use GPU when available (default) | |
| 204 | + | - `gpu`: Force GPU acceleration (Vulkan/OpenGL via GTK4) | |
| 205 | + | - `cpu`: Force software rendering | |
| 206 | + | ||
| 207 | + | ### Environment Variables | |
| 208 | + | All config values can be overridden with environment variables using the `DUMB_BROWSER_` prefix: | |
| 209 | + | ||
| 210 | + | ```bash | |
| 211 | + | # Database | |
| 212 | + | DUMB_BROWSER_DATABASE_PATH="./browser.db" | |
| 213 | + | DUMB_BROWSER_DATABASE_MAX_CONNECTIONS=5 | |
| 214 | + | ||
| 215 | + | # Rendering mode (special variable name) | |
| 216 | + | DUMBER_RENDERING_MODE="gpu" | |
| 217 | + | ||
| 218 | + | # Dmenu settings | |
| 219 | + | DUMB_BROWSER_DMENU_MAX_HISTORY_ITEMS=50 | |
| 220 | + | DUMB_BROWSER_DMENU_SHOW_VISIT_COUNT=false | |
| 221 | + | ||
| 222 | + | # Logging | |
| 223 | + | DUMB_BROWSER_LOGGING_LEVEL="debug" | |
| 224 | + | DUMB_BROWSER_LOGGING_FORMAT="json" | |
| 225 | + | ``` | |
| 226 | + | ||
| 227 | + | ### CLI Flags | |
| 228 | + | The browse command supports additional runtime flags: | |
| 229 | + | ```bash | |
| 230 | + | dumber browse --rendering-mode=gpu https://example.com | |
| 231 | + | ``` | |
| 232 | + | ||
| 110 | 233 | ||
| 111 | 234 | ## Building With WebKitGTK 6 (GTK4) | |
| 112 | 235 | - The GUI requires building with `-tags=webkit_cgo` and CGO enabled. | |
| @@ -146,12 +269,12 @@ WebKitGTK uses GStreamer for media playback. Install the following packages to e | |||
| 146 | 269 | - The `tmp/` directory is ignored by Git and kept out of history. | |
| 147 | 270 | ||
| 148 | 271 | ## Roadmap | |
| 149 | - | - WebKitGTK 6 (GTK4) migration — almost complete (GPU/Vulkan path landed). | |
| 150 | - | - GPU rendering (Vulkan via GTK4 renderer) with graceful CPU fallback. | |
| 151 | - | - Full Vim-style motion and keyboard navigation across pages and UI. | |
| 152 | - | - Performance work: faster startup, lower memory, snappier UI. | |
| 153 | - | - Basic ad-block extension — because fuck ads. | |
| 154 | - | - Other shiny things I’m not yet aware of. | |
| 272 | + | - ✅ WebKitGTK 6 (GTK4) migration (GPU/Vulkan path complete) | |
| 273 | + | - ✅ GPU rendering (Vulkan via GTK4 renderer) with graceful CPU fallback | |
| 274 | + | - Full Vim-style motion and keyboard navigation across pages and UI | |
| 275 | + | - Performance work: faster startup, lower memory, snappier UI | |
| 276 | + | - Basic ad-block extension — because fuck ads | |
| 277 | + | - Other shiny things I'm not yet aware of | |
| 155 | 278 | ||
| 156 | 279 | ## License | |
| 157 | 280 | This project is licensed under the MIT License. See `LICENSE` for details. | |
| @@ -22,41 +22,76 @@ Dumber is a minimalist browser and launcher companion focused on speed and simpl | |||||
| 22 | ## Features | 22 | ## Features | ||
| 23 | - Built‑in browser window (no external browser needed) | 23 | - Built‑in browser window (no external browser needed) | ||
| 24 | - Custom `dumb://` scheme serving embedded frontend assets | 24 | - Custom `dumb://` scheme serving embedded frontend assets | ||
| 25 | - | - Keyboard shortcuts: DevTools (F12), Omnibox toggle (Ctrl/Cmd+L), Zoom In/Out/Reset | 25 | + | - Keyboard and mouse controls: comprehensive shortcuts and gestures |
| 26 | - Persistent history with search and stats | 26 | - Persistent history with search and stats | ||
| 27 | - Per‑domain zoom persistence | 27 | - Per‑domain zoom persistence | ||
| 28 | - dmenu‑style launcher integration (rofi, fuzzel) with history and shortcut suggestions | 28 | - dmenu‑style launcher integration (rofi, fuzzel) with history and shortcut suggestions | ||
| 29 | 29 | ||||
| 30 | + | ## Controls & Shortcuts | |||
| 31 | + | ||||
| 32 | + | ### Keyboard Shortcuts | |||
| 33 | + | | Shortcut | Action | Notes | | |||
| 34 | + | |----------|--------|-------| | |||
| 35 | + | | **F12** | Open Developer Tools | WebKit inspector | | |||
| 36 | + | | **Ctrl/Cmd+L** | Open Omnibox | URL/search input with history | | |||
| 37 | + | | **Ctrl/Cmd+F** | Find in Page | Search text within current page | | |||
| 38 | + | | **Ctrl/Cmd+=** | Zoom In | Firefox-compatible zoom levels | | |||
| 39 | + | | **Ctrl/Cmd++** | Zoom In | Alternative plus key | | |||
| 40 | + | | **Ctrl/Cmd+-** | Zoom Out | Works across keyboard layouts | | |||
| 41 | + | | **Ctrl/Cmd+0** | Reset Zoom | Return to 100% zoom | | |||
| 42 | + | | **Alt+←** | Navigate Back | Go to previous page | | |||
| 43 | + | | **Alt+→** | Navigate Forward | Go to next page | | |||
| 44 | + | ||||
| 45 | + | ### Mouse Controls | |||
| 46 | + | | Action | Result | Notes | | |||
| 47 | + | |--------|---------|-------| | |||
| 48 | + | | **Ctrl+Scroll Up** | Zoom In | Smooth zoom control | | |||
| 49 | + | | **Ctrl+Scroll Down** | Zoom Out | Smooth zoom control | | |||
| 50 | + | | **Mouse Button 8** | Navigate Back | Side button (back) | | |||
| 51 | + | | **Mouse Button 9** | Navigate Forward | Side button (forward) | | |||
| 52 | + | | **Two-finger Swipe** | Back/Forward | When supported by touchpad | | |||
| 53 | + | ||||
| 54 | + | ### Omnibox/Find Mode (when active) | |||
| 55 | + | | Shortcut | Action | Notes | | |||
| 56 | + | |----------|--------|-------| | |||
| 57 | + | | **Escape** | Close overlay | Exit omnibox or find mode | | |||
| 58 | + | | **Enter** | Execute/Navigate | Navigate to URL or jump to match | | |||
| 59 | + | | **Shift+Enter** | Previous Match | Find mode: go to previous match | | |||
| 60 | + | | **Alt+Enter** | Center Match | Find mode: center on match, keep open | | |||
| 61 | + | | **↑/↓ Arrow** | Navigate Results | Browse suggestions/matches | | |||
| 62 | + | ||||
| 63 | + | All zoom changes are automatically persisted per-domain and restored on next visit. | |||
| 64 | + | ||||
| 30 | ## Quick Start | 65 | ## Quick Start | ||
| 31 | Prerequisites: | 66 | Prerequisites: | ||
| 32 | - Go 1.25+ | 67 | - Go 1.25+ | ||
| 33 | - | - Node.js 20+ (for building the embedded frontend) | 68 | + | - Node.js 20+ and npm (for building the embedded TypeScript frontend) |
| 34 | - For GUI build: WebKitGTK 6 and GTK4 dev packages (examples) | 69 | - For GUI build: WebKitGTK 6 and GTK4 dev packages (examples) | ||
| 35 | - Debian/Ubuntu: `libwebkitgtk-6.0-dev libgtk-4-dev build-essential` | 70 | - Debian/Ubuntu: `libwebkitgtk-6.0-dev libgtk-4-dev build-essential` | ||
| 36 | - Arch: `webkitgtk-6.0 gtk4 base-devel` | 71 | - Arch: `webkitgtk-6.0 gtk4 base-devel` | ||
| 37 | 72 | ||||
| 38 | Build options: | 73 | Build options: | ||
| 39 | - | - GUI (recommended): | 74 | + | - GUI (default, recommended): |
| 40 | - | - `make build-gui` # builds with `-tags=webkit_cgo` | 75 | + | - `make build` # builds frontend + Go with `-tags=webkit_cgo` |
| 41 | - Run: `./dist/dumber` # opens the embedded homepage | 76 | - Run: `./dist/dumber` # opens the embedded homepage | ||
| 42 | - CLI‑only (no GUI, CGO disabled): | 77 | - CLI‑only (no GUI, CGO disabled): | ||
| 43 | - | - `make build-static` | 78 | + | - `make build-no-gui` |
| 44 | - | - Run: `./dist/dumber-static version` | 79 | + | - Run: `./dist/dumber-no-gui version` |
| 45 | - | - Full build pipeline (frontend + Go): | |||
| 46 | - | - `make build` | |||
| 47 | 80 | ||||
| 48 | Development: | 81 | Development: | ||
| 49 | - `make dev` runs `go run .` (non‑CGO; GUI stubs log to console) | 82 | - `make dev` runs `go run .` (non‑CGO; GUI stubs log to console) | ||
| 50 | - `make test` runs tests; `make lint` runs golangci‑lint | 83 | - `make test` runs tests; `make lint` runs golangci‑lint | ||
| 51 | 84 | ||||
| 52 | ## Install | 85 | ## Install | ||
| 86 | + | **Note**: `go install` will not work for this project because the frontend assets must be built first and embedded into the binary. Use the build commands instead: | |||
| 87 | + | ||||
| 88 | + | - GUI build (default, recommended): | |||
| 89 | + | - Ensure WebKit2GTK/GTK dev packages are installed (see prerequisites) | |||
| 90 | + | - Clone the repo and run `make build` (builds frontend first, then Go with GUI support) | |||
| 91 | + | - The resulting `./dist/dumber` binary includes the native GUI window | |||
| 53 | - CLI‑only (no native window): | 92 | - CLI‑only (no native window): | ||
| 54 | - | - `go install github.com/bnema/dumber@latest` | 93 | + | - Clone the repo and run `make build-no-gui` |
| 55 | - | - Useful everywhere; runs the CLI and non‑CGO flows. In this mode the GUI code is stubbed (no native window shown). | 94 | + | - The resulting `./dist/dumber-no-gui` binary runs CLI flows with GUI code stubbed |
| 56 | - | - GUI build (Wayland + WebKit2GTK via CGO): | |||
| 57 | - | - Ensure WebKit2GTK/GTK dev packages are installed (see prerequisites) and CGO is enabled in your environment. | |||
| 58 | - | - `go install -tags webkit_cgo github.com/bnema/dumber@latest` | |||
| 59 | - | - If pkg‑config can’t find headers, set `PKG_CONFIG_PATH` appropriately or prefer `make build-gui`. | |||
| 60 | 95 | ||||
| 61 | ## Usage | 96 | ## Usage | ||
| 62 | - Open a URL or search: | 97 | - Open a URL or search: | ||
| @@ -79,34 +114,122 @@ Note: The root flag path only generates options; for processing a selection (`-- | |||||
| 79 | In GUI mode the app serves an embedded homepage via `dumb://homepage`, and frontend assets under `dumb://app/...`. | 114 | In GUI mode the app serves an embedded homepage via `dumb://homepage`, and frontend assets under `dumb://app/...`. | ||
| 80 | 115 | ||||
| 81 | ## Configuration | 116 | ## Configuration | ||
| 117 | + | ||||
| 82 | Dumber follows the XDG Base Directory spec: | 118 | Dumber follows the XDG Base Directory spec: | ||
| 83 | - Config: `~/.config/dumber/config.json` | 119 | - Config: `~/.config/dumber/config.json` | ||
| 84 | - Data: `~/.local/share/dumber` | 120 | - Data: `~/.local/share/dumber` | ||
| 85 | - State: `~/.local/state/dumber` (default DB lives here) | 121 | - State: `~/.local/state/dumber` (default DB lives here) | ||
| 86 | 122 | ||||
| 87 | - | A default `config.json` is created on first run. Key fields: | 123 | + | A default `config.json` is created on first run. Config changes are watched and applied at runtime when possible. |
| 88 | - | - `database.path`: SQLite database path (defaults to XDG state dir `history.db`) | 124 | + | |
| 89 | - | - `search_shortcuts`: map of search shortcuts, e.g. | 125 | + | ### Complete Configuration Reference |
| 90 | - | ```json | 126 | + | |
| 91 | - | { | 127 | + | #### Database Configuration |
| 92 | - | "g": { "url": "https://www.google.com/search?q=%s", "description": "Google" }, | 128 | + | ```json |
| 93 | - | "gh": { "url": "https://github.com/search?q=%s", "description": "GitHub" } | 129 | + | "database": { |
| 94 | - | } | 130 | + | "path": "~/.local/state/dumber/history.db", |
| 95 | - | ``` | 131 | + | "max_connections": 1, |
| 96 | - | - `appearance`: default fonts and base font size for pages without specified fonts | 132 | + | "max_idle_time": "5m0s", |
| 97 | - | - `dmenu`: options for launcher integration (history count, prefixes, etc.) | 133 | + | "query_timeout": "30s" |
| 98 | - | 134 | + | } | |
| 99 | - | Environment variables use the `DUMB_BROWSER_` prefix (managed by Viper). Examples: | 135 | + | ``` |
| 100 | - | - `DUMB_BROWSER_DATABASE_PATH=...` | 136 | + | |
| 101 | - | - `DUMB_BROWSER_DMENU_MAX_HISTORY_ITEMS=50` | 137 | + | #### History Management |
| 102 | - | 138 | + | ```json | |
| 103 | - | Config changes are watched and applied at runtime when possible. | 139 | + | "history": { |
| 104 | - | 140 | + | "max_entries": 10000, | |
| 105 | - | ## Data Model | 141 | + | "retention_period_days": 365, |
| 106 | - | SQLite tables (created automatically): | 142 | + | "cleanup_interval_days": 1 |
| 107 | - | - `history(id, url, title, visit_count, last_visited, created_at)` | 143 | + | } |
| 108 | - | - `shortcuts(shortcut, url_template, description, created_at)` | 144 | + | ``` |
| 109 | - | - `zoom_levels(domain PRIMARY KEY, zoom_factor, updated_at)` | 145 | + | |
| 146 | + | #### Search Shortcuts | |||
| 147 | + | ```json | |||
| 148 | + | "search_shortcuts": { | |||
| 149 | + | "g": { "url": "https://www.google.com/search?q=%s", "description": "Google search" }, | |||
| 150 | + | "gh": { "url": "https://github.com/search?q=%s", "description": "GitHub search" }, | |||
| 151 | + | "yt": { "url": "https://www.youtube.com/results?search_query=%s", "description": "YouTube search" }, | |||
| 152 | + | "w": { "url": "https://en.wikipedia.org/wiki/%s", "description": "Wikipedia search" }, | |||
| 153 | + | "ddg": { "url": "https://duckduckgo.com/?q=%s", "description": "DuckDuckGo search" }, | |||
| 154 | + | "so": { "url": "https://stackoverflow.com/search?q=%s", "description": "Stack Overflow search" }, | |||
| 155 | + | "r": { "url": "https://www.reddit.com/search?q=%s", "description": "Reddit search" }, | |||
| 156 | + | "npm": { "url": "https://www.npmjs.com/search?q=%s", "description": "npm package search" }, | |||
| 157 | + | "go": { "url": "https://pkg.go.dev/search?q=%s", "description": "Go package search" }, | |||
| 158 | + | "mdn": { "url": "https://developer.mozilla.org/en-US/search?q=%s", "description": "MDN Web Docs search" } | |||
| 159 | + | } | |||
| 160 | + | ``` | |||
| 161 | + | ||||
| 162 | + | #### Dmenu Integration | |||
| 163 | + | ```json | |||
| 164 | + | "dmenu": { | |||
| 165 | + | "max_history_items": 20, | |||
| 166 | + | "show_visit_count": true, | |||
| 167 | + | "show_last_visited": true, | |||
| 168 | + | "history_prefix": "🕒", | |||
| 169 | + | "shortcut_prefix": "🔍", | |||
| 170 | + | "url_prefix": "🌐", | |||
| 171 | + | "date_format": "2006-01-02 15:04", | |||
| 172 | + | "sort_by_visit_count": true | |||
| 173 | + | } | |||
| 174 | + | ``` | |||
| 175 | + | ||||
| 176 | + | #### Logging Configuration | |||
| 177 | + | ```json | |||
| 178 | + | "logging": { | |||
| 179 | + | "level": "info", | |||
| 180 | + | "format": "text", | |||
| 181 | + | "filename": "", | |||
| 182 | + | "max_size": 100, | |||
| 183 | + | "max_backups": 3, | |||
| 184 | + | "max_age": 7, | |||
| 185 | + | "compress": true | |||
| 186 | + | } | |||
| 187 | + | ``` | |||
| 188 | + | ||||
| 189 | + | #### Appearance Settings | |||
| 190 | + | ```json | |||
| 191 | + | "appearance": { | |||
| 192 | + | "sans_font": "Fira Sans", | |||
| 193 | + | "serif_font": "Fira Sans", | |||
| 194 | + | "monospace_font": "Fira Code", | |||
| 195 | + | "default_font_size": 16 | |||
| 196 | + | } | |||
| 197 | + | ``` | |||
| 198 | + | ||||
| 199 | + | #### Rendering Mode (GPU/CPU) | |||
| 200 | + | ```json | |||
| 201 | + | "rendering_mode": "auto" | |||
| 202 | + | ``` | |||
| 203 | + | - `auto`: Detect GPU availability and use GPU when available (default) | |||
| 204 | + | - `gpu`: Force GPU acceleration (Vulkan/OpenGL via GTK4) | |||
| 205 | + | - `cpu`: Force software rendering | |||
| 206 | + | ||||
| 207 | + | ### Environment Variables | |||
| 208 | + | All config values can be overridden with environment variables using the `DUMB_BROWSER_` prefix: | |||
| 209 | + | ||||
| 210 | + | ```bash | |||
| 211 | + | # Database | |||
| 212 | + | DUMB_BROWSER_DATABASE_PATH="./browser.db" | |||
| 213 | + | DUMB_BROWSER_DATABASE_MAX_CONNECTIONS=5 | |||
| 214 | + | ||||
| 215 | + | # Rendering mode (special variable name) | |||
| 216 | + | DUMBER_RENDERING_MODE="gpu" | |||
| 217 | + | ||||
| 218 | + | # Dmenu settings | |||
| 219 | + | DUMB_BROWSER_DMENU_MAX_HISTORY_ITEMS=50 | |||
| 220 | + | DUMB_BROWSER_DMENU_SHOW_VISIT_COUNT=false | |||
| 221 | + | ||||
| 222 | + | # Logging | |||
| 223 | + | DUMB_BROWSER_LOGGING_LEVEL="debug" | |||
| 224 | + | DUMB_BROWSER_LOGGING_FORMAT="json" | |||
| 225 | + | ``` | |||
| 226 | + | ||||
| 227 | + | ### CLI Flags | |||
| 228 | + | The browse command supports additional runtime flags: | |||
| 229 | + | ```bash | |||
| 230 | + | dumber browse --rendering-mode=gpu https://example.com | |||
| 231 | + | ``` | |||
| 232 | + | ||||
| 110 | 233 | ||||
| 111 | ## Building With WebKitGTK 6 (GTK4) | 234 | ## Building With WebKitGTK 6 (GTK4) | ||
| 112 | - The GUI requires building with `-tags=webkit_cgo` and CGO enabled. | 235 | - The GUI requires building with `-tags=webkit_cgo` and CGO enabled. | ||
| @@ -146,12 +269,12 @@ WebKitGTK uses GStreamer for media playback. Install the following packages to e | |||||
| 146 | - The `tmp/` directory is ignored by Git and kept out of history. | 269 | - The `tmp/` directory is ignored by Git and kept out of history. | ||
| 147 | 270 | ||||
| 148 | ## Roadmap | 271 | ## Roadmap | ||
| 149 | - | - WebKitGTK 6 (GTK4) migration — almost complete (GPU/Vulkan path landed). | 272 | + | - ✅ WebKitGTK 6 (GTK4) migration (GPU/Vulkan path complete) |
| 150 | - | - GPU rendering (Vulkan via GTK4 renderer) with graceful CPU fallback. | 273 | + | - ✅ GPU rendering (Vulkan via GTK4 renderer) with graceful CPU fallback |
| 151 | - | - Full Vim-style motion and keyboard navigation across pages and UI. | 274 | + | - Full Vim-style motion and keyboard navigation across pages and UI |
| 152 | - | - Performance work: faster startup, lower memory, snappier UI. | 275 | + | - Performance work: faster startup, lower memory, snappier UI |
| 153 | - | - Basic ad-block extension — because fuck ads. | 276 | + | - Basic ad-block extension — because fuck ads |
| 154 | - | - Other shiny things I’m not yet aware of. | 277 | + | - Other shiny things I'm not yet aware of |
| 155 | 278 | ||||
| 156 | ## License | 279 | ## License | ||
| 157 | This project is licensed under the MIT License. See `LICENSE` for details. | 280 | This project is licensed under the MIT License. See `LICENSE` for details. | ||