-
-
Notifications
You must be signed in to change notification settings - Fork 385
/
Copy pathuser_options.js
256 lines (253 loc) · 8.88 KB
/
user_options.js
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
import GLib from 'gi://GLib';
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'
import userOverrides from '../../user_options.js';
// Default options.
// Add overrides in ~/.config/ags/user_options.js
let configOptions = {
// General stuff
'ai': {
'defaultGPTProvider': "openai",
'defaultTemperature': 0.9,
'enhancements': true,
'useHistory': true,
'writingCursor': " ...", // Warning: Using weird characters can mess up Markdown rendering
'proxyUrl': null, // Can be "socks5://127.0.0.1:9050" or "http://127.0.0.1:8080" for example. Leave it blank if you don't need it.
},
'animations': {
'choreographyDelay': 35,
'durationSmall': 110,
'durationLarge': 180,
},
'appearance': {
'autoDarkMode': { // Turns on dark mode in certain hours. Time in 24h format
'enabled': false,
'from': "18:10",
'to': "6:10",
},
'keyboardUseFlag': false, // Use flag emoji instead of abbreviation letters
'layerSmoke': false,
'layerSmokeStrength': 0.2,
'fakeScreenRounding': 1, // 0: None | 1: Always | 2: When not fullscreen
},
'apps': {
'bluetooth': "blueberry",
'imageViewer': "loupe",
'network': "XDG_CURRENT_DESKTOP=\"gnome\" gnome-control-center wifi",
'settings': "XDG_CURRENT_DESKTOP=\"gnome\" gnome-control-center",
'taskManager': "gnome-usage",
'terminal': "foot", // This is only for shell actions
},
'battery': {
'low': 20,
'critical': 10,
'warnLevels': [20, 15, 5],
'warnTitles': ["Low battery", "Very low battery", 'Critical Battery'],
'warnMessages': ["Plug in the charger", "You there?", 'PLUG THE CHARGER ALREADY'],
'suspendThreshold': 3,
},
'brightness': {
// Object of controller names for each monitor, either "brightnessctl" or "ddcutil" or "auto"
// 'default' one will be used if unspecified
// Examples
// 'eDP-1': "brightnessctl",
// 'DP-1': "ddcutil",
'controllers': {
'default': "auto",
},
},
'cheatsheet': {
'keybinds': {
'configPath': "" // Path to hyprland keybind config file. Leave empty for default (~/.config/hypr/hyprland/keybinds.conf)
}
},
'gaming': {
'crosshair': {
'size': 20,
'color': 'rgba(113,227,32,0.9)',
},
},
'monitors': {
'scaleMethod': "division", // Either "division" [default] or "gdk"
},
'music': {
'preferredPlayer': "plasma-browser-integration",
},
'onScreenKeyboard': {
'layout': "qwerty_full", // See modules/onscreenkeyboard/onscreenkeyboard.js for available layouts
},
'overview': {
'scale': 0.18, // Relative to screen size
'numOfRows': 2,
'numOfCols': 5,
'wsNumScale': 0.09,
'wsNumMarginScale': 0.07,
},
'sidebar': {
'ai': {
'extraGptModels': {
'oxygen3': {
'name': 'Oxygen (GPT-3.5)',
'logo_name': 'ai-oxygen-symbolic',
'description': 'An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key',
'base_url': 'https://app.oxyapi.uk/v1/chat/completions',
'key_get_url': 'https://discord.com/invite/kM6MaCqGKA',
'key_file': 'oxygen_key.txt',
'model': 'gpt-3.5-turbo',
},
}
},
'image': {
'columns': 2,
'batchCount': 20,
'allowNsfw': false,
},
'pages': {
'order': ["apis", "tools"],
'apis': {
'order': ["gemini", "gpt", "waifu", "booru"],
}
},
},
'search': {
'enableFeatures': {
'actions': true,
'commands': true,
'mathResults': true,
'directorySearch': true,
'aiSearch': true,
'webSearch': true,
},
'engineBaseUrl': "https://www.google.com/search?q=",
'excludedSites': ["quora.com"],
},
'time': {
// See https://docs.gtk.org/glib/method.DateTime.format.html
// Here's the 12h format: "%I:%M%P"
// For seconds, add "%S" and set interval to 1000
'format': "%H:%M",
'interval': 5000,
'dateFormatLong': "%A, %d/%m", // On bar
'dateInterval': 5000,
'dateFormat': "%d/%m", // On notif time
},
'wallpaper': {
'path': "$HOME/Pictures/wallpapers", // wallpaper folder
'autoChange': false, // Changes wallpaper regularly
'interval': 1800, // In seconds
'smart': true, // sets dark / light mode based on wallpaper
'popup': true, // Shows a color preview when changing wallpaper
},
'weather': {
'city': "",
'preferredUnit': "C", // Either C or F
},
'workspaces': {
'shown': 10,
},
'dock': {
'enabled': false,
'hiddenThickness': 5,
'pinnedApps': ['firefox', 'org.gnome.Nautilus'],
'layer': 'top',
'monitorExclusivity': true, // Dock will move to other monitor along with focus if enabled
'searchPinnedAppIcons': false, // Try to search for the correct icon if the app class isn't an icon name
'trigger': ['client-added', 'client-removed'], // client_added, client_move, workspace_active, client_active
// Automatically hide dock after `interval` ms since trigger
'autoHide': [
{
'trigger': 'client-added',
'interval': 500,
},
{
'trigger': 'client-removed',
'interval': 500,
},
],
},
// Longer stuff
'icons': {
// Find the window's icon by its class with levenshteinDistance
// The file names are processed at startup, so if there
// are too many files in the search path it'll affect performance
// Example: ['/usr/share/icons/Tela-nord/scalable/apps']
'searchPaths': [''],
'symbolicIconTheme': {
"dark": "Adwaita",
"light": "Adwaita",
},
substitutions: {
'code-url-handler': "visual-studio-code",
'Code': "visual-studio-code",
'GitHub Desktop': "github-desktop",
'Minecraft* 1.20.1': "minecraft",
'gnome-tweaks': "org.gnome.tweaks",
'pavucontrol-qt': "pavucontrol",
'wps': "wps-office2019-kprometheus",
'wpsoffice': "wps-office2019-kprometheus",
'': "image-missing",
},
regexSubstitutions: [
{
regex: /^steam_app_(\d+)$/,
replace: "steam_icon_$1",
}
]
},
'keybinds': {
// Format: Mod1+Mod2+key. CaSe SeNsItIvE!
// Modifiers: Shift Ctrl Alt Hyper Meta
// See https://docs.gtk.org/gdk3/index.html#constants for the other keys (they are listed as KEY_key)
'overview': {
'altMoveLeft': "Ctrl+b",
'altMoveRight': "Ctrl+f",
'deleteToEnd': "Ctrl+k",
},
'sidebar': {
'apis': {
'nextTab': "Page_Down",
'prevTab': "Page_Up",
},
'options': { // Right sidebar
'nextTab': "Page_Down",
'prevTab': "Page_Up",
},
'pin': "Ctrl+p",
'cycleTab': "Ctrl+Tab",
'nextTab': "Ctrl+Page_Down",
'prevTab': "Ctrl+Page_Up",
},
'cheatsheet': {
'keybinds': {
'nextTab': "Page_Down",
'prevTab': "Page_Up",
},
'nextTab': "Ctrl+Page_Down",
'prevTab': "Ctrl+Page_Up",
'cycleTab': "Ctrl+Tab",
}
},
}
// Override defaults with user's options
let optionsOkay = true;
function overrideConfigRecursive(userOverrides, configOptions = {}, check = true) {
for (const [key, value] of Object.entries(userOverrides)) {
if (configOptions[key] === undefined && check) {
optionsOkay = false;
}
else if (typeof value === 'object' && !(value instanceof Array)) {
if (key === "substitutions" || key === "regexSubstitutions" || key === "extraGptModels") {
overrideConfigRecursive(value, configOptions[key], false);
} else overrideConfigRecursive(value, configOptions[key]);
} else {
configOptions[key] = value;
}
}
}
overrideConfigRecursive(userOverrides, configOptions);
if (!optionsOkay) Utils.timeout(2000, () => Utils.execAsync(['notify-send',
'Update your user options',
'One or more config options don\'t exist',
'-a', 'ags',
]).catch(print))
globalThis['userOptions'] = configOptions;
export default configOptions;