mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-29 16:45:34 +02:00
✨ Adds new helper function to handle item hotkeys
This commit is contained in:
parent
a05998f611
commit
5c3667003a
@ -60,3 +60,17 @@ export const getCustomColors = () => {
|
|||||||
const configColors = config.appConfig.customColors || {};
|
const configColors = config.appConfig.customColors || {};
|
||||||
return Object.assign(configColors, localColors);
|
return Object.assign(configColors, localColors);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of items which the user has assigned a hotkey to
|
||||||
|
* So that when the hotkey is pressed, the app/ service can be launched
|
||||||
|
*/
|
||||||
|
export const getCustomKeyShortcuts = () => {
|
||||||
|
const results = [];
|
||||||
|
const sections = config.sections || [];
|
||||||
|
sections.forEach((section) => {
|
||||||
|
const itemsWithHotKeys = section.items.filter(item => item.hotkey);
|
||||||
|
results.push(itemsWithHotKeys.map(item => ({ hotkey: item.hotkey, url: item.url })));
|
||||||
|
});
|
||||||
|
return results.flat();
|
||||||
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user