Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:sparkles: Adds new helper function to handle item hotkeys

Alicia Sykes5c3667003ad4
diff --git a/src/utils/ConfigHelpers.js b/src/utils/ConfigHelpers.js
index 97003b57..a1848b66 100644
--- a/src/utils/ConfigHelpers.js
+++ b/src/utils/ConfigHelpers.js
@@ -60,3 +60,17 @@ export const getCustomColors = () => {
const configColors = config.appConfig.customColors || {};
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();
+};