-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.types.ts
More file actions
203 lines (172 loc) · 5.76 KB
/
config.types.ts
File metadata and controls
203 lines (172 loc) · 5.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// Configuration read errors are logged to the console, unknown values
// are ignored (use it to "comment out" keys), merging with builtin config is **shallow**.
import { ICustomShortcut } from '../renderer/runtime/parsing/parseCustomShortcuts';
export interface IAppConfig {
/**
* Themes:
* - `default`: a dark theme with lime colored highlights
* - `ambiance`: ubuntu-like dark brown and orange colors
*/
theme: 'default' | 'ambiance' | 'aquamint';
/**
* Main window width
* Default is **800** pixels.
*/
winWidth: number;
/**
* Fluxbox menu file location, you can disable parsing with an explicit `false`.
* Default is **"~/.fluxbox/menu"**.
*/
fluxboxMenuFile: string | false;
/**
* Start with a borderless window? `false` may cause height problems on Windows.
* Default is **true**.
*/
borderlessWindow: boolean;
/**
* Do not center by default, use fixed coords (in case auto centering/resizing fails).
*
* Examples: `[]`, `[100, 50]`, `null` or `undefined`
*/
fixPosition: [number, number];
/**
* change the resize values, width and height (in case auto resizing fails)
* examples: `[]`, `[0, -3]`
* (subtracts 3 pixels from the new height), `null` or `undefined`
*/
modifyResize: [number, number];
/**
* Window show timeout in msec, to avoid the initial blink caused by the unpainted white bg.
* Default is **0**.
*/
paintDelay: number;
/**
* Show the main window on startup?
* Default is **false**.
*/
showOnStartup: boolean;
/**
* Auto center window position on show.
* Default is **true**.
*/
centerOnShow: boolean;
/**
* auto select text in the search field after a successful launch and reopen?
*/
autoSelectAll: boolean;
/**
* tray icon size; `small` = 16x16, `large` = 64x64 (will use the selected png from assets)
*/
trayIconSize: 'small' | 'large';
/**
* Window toggle key, see electron launcher keys at https://www.electronjs.org/docs/latest/tutorial/keyboard-shortcuts#accelerators
* Modifiers are: `Cmd`, `Ctrl`, `CmdOrCtrl`, `Alt`, `Option`, `AltGr`, `Shift`, `Super`.
*
* Example: `["Super+x", "CmdOrCtrl+Alt+Shift+x"]`
*/
toggleKey: string[];
/**
* All words separated by this string are used in an AND relation for searching.
* Default is **" "** (space).
*/
logicalAndSeparator: string;
/**
* gnome .desktop files' location, this is only used for a basic "is desktop executable"
* detection (while checking executables on the path), this is NOT for launching .desktop files
*/
desktopFilesLocation: string;
/**
* files included in the search, array of regex strings
*
* Example: `["\\.(txt|md|html|docx|pdf|jpe?g|png|avi|mkv|mp4)$"]`
*/
includeFiles: string[];
/**
* files excluded from the search
*
* Example: `["^\\._"]`
*/
excludeFiles: string[];
/**
* Directories excluded from the search.
*
* Example: `["^node_modules$", "^\\."]`
*/
excludedDirs: string[];
/**
* Exclude hidden and system files (Windows),
* **NOT YET IMPLEMENTED**
*/
excludeHidSys: boolean;
/**
* You can explicitly disable the path parsing (for executables) with `true`, this is mostly for debugging;
* note that this will render the exec input field useless
*/
skipPathParsing: boolean;
/**
* Terminal command template, you have to escape it yourself if it has spaces in the path.
* This is the command for the "launchInTerminal" appShortcut.
*
* Exmaple: `"gnome-terminal -- %CMD%"`
*/
terminalCommand: string;
/**
* Words that can be used in the "app" input field.
*/
appShortcuts: {
/** Default: **"F"**, shell open in file manager. */
showItemInFolder: string;
/** Default: **"T"**, see: `terminalCommand`. */
launchInTerminal: string;
};
/**
* Override system default applications, executables must have a full path or be on the path.
*
* Example: `{ "\\.(txt|md)$": "code" }`
*/
openWith: Record<string, string>;
/**
* Override the launched executable's parameters (by default it's the filename with its full path)
* (path + name = command); valid replacables: %PATH%, %NAME%, %COMMAND%, %TYPE%, %ID%
*
* Example: `{ "gtk-launch": "%NAME%" }`
*/
openWithParams: Record<string, string>;
/**
* Directories to index, home "~" marker is supported.
*/
directories: string[];
/**
* Dumb feature flag switch for development.
*/
betaFeatures: boolean;
/**
* Hardcoded custom shortcuts. Items extend spawn options (without stdio);
* see: https://nodejs.org/api/child_process.html#child-processspawncommand-args-options
* most important ones are: `cwd`, `env`, `detached`, `shell`, `windowsHide`, `timeout`
*
* Exmaple:
* ```
* [
* { "title": "browser/firefox-profiles", "command": "C:\\Program Files\\Mozilla Firefox\\firefox.exe", "args": "-p" },
* { "title": "browser/ungoogled-chromium", "command": "D:/bin/ungoogled-chromium-127/ug-chrome.exe" },
* { "title": "image-editing/gimp", "command": "~/AppData/Local/Programs/GIMP 3/bin/gimp.exe" }
* ]
* ```
*/
customShortcuts?: ICustomShortcut[];
/**
* Path to a final "extra" config that can be loaded from anywhere;
* added this so that I can reference a config from a dropbox/onedrive shared storage.
*
* This will be loaded last and can be placed in any of the three config files
* (internal, .local override, one in the user's home config dir).
*/
extraConfigPath?: string;
// INTERNAL CONFIG VALUES
// ----------------------
/** **Internal**: set from argv using `--development` or `-d` */
development: boolean;
/** **Internal**: same as in nwjs (`~/.config/appName` on linux); see: https://www.electronjs.org/docs/latest/api/app#appgetpathname */
dataPath: string;
}