forked from Shinonome/dots-hyprland
fix user options by making loader recursive (#318)
This commit is contained in:
@@ -94,11 +94,17 @@ let configOptions = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load user's options
|
// Override defaults with user's options
|
||||||
Object.entries(userOverrides).forEach((override) => {
|
function overrideConfigRecursive(userOverrides, configOptions = {}) {
|
||||||
const [key, value] = override;
|
for (const [key, value] of Object.entries(userOverrides)) {
|
||||||
configOptions[key] = value;
|
if (typeof value === 'object') {
|
||||||
});
|
overrideConfigRecursive(value, configOptions[key]);
|
||||||
|
} else {
|
||||||
|
configOptions[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
overrideConfigRecursive(userOverrides, configOptions);
|
||||||
|
|
||||||
globalThis['userOptions'] = configOptions;
|
globalThis['userOptions'] = configOptions;
|
||||||
export default configOptions;
|
export default configOptions;
|
||||||
@@ -5,12 +5,7 @@ const userConfigOptions = {
|
|||||||
// Here's an example
|
// Here's an example
|
||||||
'keybinds': {
|
'keybinds': {
|
||||||
'sidebar': {
|
'sidebar': {
|
||||||
'apis': {
|
|
||||||
'nextTab': "Page_Down",
|
|
||||||
'prevTab': "Page_Up",
|
|
||||||
},
|
|
||||||
'pin': "Ctrl+p",
|
'pin': "Ctrl+p",
|
||||||
'cycleTab': "Ctrl+Tab",
|
|
||||||
'nextTab': "Ctrl+Page_Down",
|
'nextTab': "Ctrl+Page_Down",
|
||||||
'prevTab': "Ctrl+Page_Up",
|
'prevTab': "Ctrl+Page_Up",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user