v0.20.0 c741a39

defaults.go RawHistoryFolder

1package config
2
3// Default configuration constants
4const (
5	// History defaults
6	defaultMaxHistoryEntries = 10000 // entries
7	defaultRetentionDays     = 365   // 1 year
8
9	// Dmenu defaults
10	defaultMaxHistoryItems = 20 // items
11
12	// Logging defaults
13	defaultMaxLogAgeDays = 7 // days
14
15	// Appearance defaults
16	defaultFontSize = 16 // points
17
18	// Omnibox defaults
19	defaultOmniboxInitialBehavior = "recent"
20
21	// Workspace defaults
22	defaultPaneActivationShortcut  = "ctrl+p"
23	defaultPaneTimeoutMilliseconds = 3000
24	defaultTabActivationShortcut   = "ctrl+t"
25	defaultTabTimeoutMilliseconds  = 3000
26	defaultTabBarPosition          = "bottom"
27	defaultPopupPlacement          = "right"
28
29	// Workspace styling defaults
30	// Active pane border (overlay)
31	defaultBorderWidth = 1
32	defaultBorderColor = "@theme_selected_bg_color"
33
34	// Pane mode border (Ctrl+P N - overlay)
35	defaultPaneModeBorderWidth = 4
36	defaultPaneModeBorderColor = "#4A90E2" // Blue for pane mode indicator
37
38	// Tab mode border (Ctrl+P T - overlay)
39	defaultTabModeBorderWidth = 4
40	defaultTabModeBorderColor = "#FFA500" // Orange for tab mode indicator
41
42	// Other styling
43	defaultTransitionDuration = 120
44	defaultUIScale            = 1.0 // UI scale multiplier (1.0 = 100%, 1.2 = 120%)
45)
46
47// getDefaultLogDir returns the default log directory, falls back to empty string on error
48func getDefaultLogDir() string {
49	logDir, err := GetLogDir()
50	if err != nil {
51		return ""
52	}
53	return logDir
54}
55
56// DefaultConfig returns the default configuration values for dumber.
57func DefaultConfig() *Config {
58	return &Config{
59		Database: DatabaseConfig{
60			// Path is set dynamically in config.Load()
61		},
62		History: HistoryConfig{
63			MaxEntries:          defaultMaxHistoryEntries,
64			RetentionPeriodDays: defaultRetentionDays, // 1 year
65			CleanupIntervalDays: 1,                    // daily cleanup
66		},
67		SearchShortcuts:     GetDefaultSearchShortcuts(),
68		DefaultSearchEngine: "https://duckduckgo.com/?q=%s",
69		Dmenu: DmenuConfig{
70			MaxHistoryItems:  defaultMaxHistoryItems,
71			ShowVisitCount:   true,
72			ShowLastVisited:  true,
73			HistoryPrefix:    "🕒",
74			ShortcutPrefix:   "🔍",
75			URLPrefix:        "🌐",
76			DateFormat:       "2006-01-02 15:04",
77			SortByVisitCount: true,
78		},
79		Logging: LoggingConfig{
80			Level:          "info",
81			Format:         "text", // text or json
82			MaxAge:         defaultMaxLogAgeDays,
83			LogDir:         getDefaultLogDir(),
84			EnableFileLog:  true,
85			CaptureConsole: false, // Disabled by default
86		},
87		Appearance: AppearanceConfig{
88			SansFont:        "Fira Sans",
89			SerifFont:       "Fira Sans",
90			MonospaceFont:   "Fira Code",
91			DefaultFontSize: defaultFontSize,
92			LightPalette: ColorPalette{
93				Background:     "#fafafa",
94				Surface:        "#f4f4f5",
95				SurfaceVariant: "#e4e4e7",
96				Text:           "#18181b",
97				Muted:          "#71717a",
98				Accent:         "#22c55e", // Green-500 - vibrant primary
99				Border:         "#d4d4d8",
100			},
101			DarkPalette: ColorPalette{
102				Background:     "#0a0a0b",
103				Surface:        "#18181b",
104				SurfaceVariant: "#27272a",
105				Text:           "#fafafa",
106				Muted:          "#a1a1aa",
107				Accent:         "#4ade80", // Green-400 - vibrant primary
108				Border:         "#3f3f46",
109			},
110			ColorScheme: "default", // default follows system theme
111		},
112		Debug: DebugConfig{
113			EnableDevTools: true,
114		},
115		Rendering: RenderingConfig{
116			Mode:                      RenderingModeGPU,
117			DisableDMABufRenderer:     false,
118			ForceCompositingMode:      false,
119			DisableCompositingMode:    false,
120			GSKRenderer:               GSKRendererVulkan,
121			DisableMipmaps:            false,
122			PreferGL:                  false,
123			DrawCompositingIndicators: false,
124			ShowFPS:                   false,
125			SampleMemory:              false,
126			DebugFrames:               false,
127		},
128		DefaultWebpageZoom: 1.2,            // 120% default zoom for better readability
129		DefaultUIScale:     defaultUIScale, // 1.0 = 100%, 2.0 = 200%
130		Workspace: WorkspaceConfig{
131			PaneMode: PaneModeConfig{
132				ActivationShortcut:  defaultPaneActivationShortcut,
133				TimeoutMilliseconds: defaultPaneTimeoutMilliseconds,
134				Actions: map[string][]string{
135					"split-right": {"arrowright", "r"},
136					"split-left":  {"arrowleft", "l"},
137					"split-up":    {"arrowup", "u"},
138					"split-down":  {"arrowdown", "d"},
139					"stack-pane":  {"s"},
140					"close-pane":  {"x"},
141					"focus-right": {"shift+arrowright", "shift+l"},
142					"focus-left":  {"shift+arrowleft", "shift+h"},
143					"focus-up":    {"shift+arrowup", "shift+k"},
144					"focus-down":  {"shift+arrowdown", "shift+j"},
145					"confirm":     {"enter"},
146					"cancel":      {"escape"},
147				},
148			},
149			TabMode: TabModeConfig{
150				ActivationShortcut:  defaultTabActivationShortcut,
151				TimeoutMilliseconds: defaultTabTimeoutMilliseconds,
152				Actions: map[string][]string{
153					"new-tab":      {"n", "c"},
154					"close-tab":    {"x"},
155					"next-tab":     {"l", "tab"},
156					"previous-tab": {"h", "shift+tab"},
157					"rename-tab":   {"r"},
158					"confirm":      {"enter"},
159					"cancel":       {"escape"},
160				},
161			},
162			Shortcuts: GlobalShortcutsConfig{
163				ClosePane:   "ctrl+w",
164				NextTab:     "ctrl+tab",
165				PreviousTab: "ctrl+shift+tab",
166			},
167			TabBarPosition:          defaultTabBarPosition,
168			HideTabBarWhenSingleTab: true,
169			Popups: PopupBehaviorConfig{
170				Behavior:             PopupBehaviorSplit, // Default: open JavaScript popups in split panes
171				Placement:            defaultPopupPlacement,
172				OpenInNewPane:        true,
173				FollowPaneContext:    true,
174				BlankTargetBehavior:  "stacked", // Default: open _blank links in stacked mode
175				EnableSmartDetection: true,      // Use WindowProperties to detect popup vs tab
176				OAuthAutoClose:       true,      // Auto-close OAuth popups on success
177			},
178			Styling: WorkspaceStylingConfig{
179				BorderWidth:         defaultBorderWidth,
180				BorderColor:         defaultBorderColor,
181				PaneModeBorderWidth: defaultPaneModeBorderWidth,
182				PaneModeBorderColor: defaultPaneModeBorderColor,
183				TabModeBorderWidth:  defaultTabModeBorderWidth,
184				TabModeBorderColor:  defaultTabModeBorderColor,
185				TransitionDuration:  defaultTransitionDuration,
186			},
187		},
188		ContentFiltering: ContentFilteringConfig{
189			Enabled:    true, // Ad blocking enabled by default
190			AutoUpdate: true, // Auto-update filters from GitHub releases
191		},
192		Omnibox: OmniboxConfig{
193			InitialBehavior: defaultOmniboxInitialBehavior,
194		},
195		Media: MediaConfig{
196			HardwareDecodingMode:     HardwareDecodingAuto, // auto allows sw fallback
197			PreferAV1:                true,                 // AV1 is most efficient codec
198			ShowDiagnosticsOnStartup: true,                 // Warn users if HW accel unavailable
199			ForceVSync:               false,                // Let compositor handle VSync
200			GLRenderingMode:          GLRenderingModeAuto,  // GStreamer picks best GL API
201			GStreamerDebugLevel:      0,                    // Disabled by default
202			VideoBufferSizeMB:        64,                   // Larger buffer for bursty streams (Twitch, YouTube)
203			QueueBufferTimeSec:       20,                   // More prebuffering for smooth playback
204		},
205		Runtime: RuntimeConfig{
206			Prefix: "",
207		},
208	}
209}
210
211// GetDefaultSearchShortcuts returns the default search shortcuts.
212func GetDefaultSearchShortcuts() map[string]SearchShortcut {
213	return map[string]SearchShortcut{
214		"ddg": {
215			URL:         "https://duckduckgo.com/?q=%s",
216			Description: "DuckDuckGo search",
217		},
218		"g": {
219			URL:         "https://www.google.com/search?q=%s",
220			Description: "Google search",
221		},
222		"gi": {
223			URL:         "https://www.google.com/search?tbm=isch&q=%s",
224			Description: "Google Images search",
225		},
226		"gh": {
227			URL:         "https://github.com/search?q=%s",
228			Description: "GitHub search",
229		},
230		"go": {
231			URL:         "https://pkg.go.dev/search?q=%s",
232			Description: "Go package search",
233		},
234		"mdn": {
235			URL:         "https://developer.mozilla.org/en-US/search?q=%s",
236			Description: "MDN Web Docs search",
237		},
238		"npm": {
239			URL:         "https://www.npmjs.com/search?q=%s",
240			Description: "npm package search",
241		},
242		"r": {
243			URL:         "https://www.reddit.com/search?q=%s",
244			Description: "Reddit search",
245		},
246		"so": {
247			URL:         "https://stackoverflow.com/search?q=%s",
248			Description: "Stack Overflow search",
249		},
250		"w": {
251			URL:         "https://en.wikipedia.org/wiki/%s",
252			Description: "Wikipedia search",
253		},
254		"yt": {
255			URL:         "https://www.youtube.com/results?search_query=%s",
256			Description: "YouTube search",
257		},
258	}
259}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close