-
-
-
-
+
+
+
+
+
+
+
+
+ {{ hotkey }}
+
@@ -23,6 +28,7 @@ export default {
isSmall: Boolean, // If true, will apply small class
position: String, // Position classes: top, bottom, left, right
isTransparent: Boolean, // If true, will apply opacity
+ hotkey: Number, // Optional hotkey to also display
},
methods: {
/* Returns custom class string, from optional props */
@@ -49,7 +55,6 @@ export default {
width: 1rem;
margin: 2px;
path {
- // fill: var(--primary);
fill: currentColor;
}
}
@@ -68,4 +73,17 @@ export default {
}
}
+div.hotkey-denominator {
+ position: absolute;
+ font-size: 0.8rem;
+ margin: 2px;
+ bottom: 2px;
+ color: currentColor;
+ border-radius: 18px;
+ border: 1px solid currentColor;
+ padding: 0.1rem 0.4rem 0.2rem 0.4rem;
+ &.top { right: 0; } // Position opposite of opening method icon
+ &.bottom { left: 0; }
+}
+
diff --git a/src/components/Settings/SearchBar.vue b/src/components/Settings/SearchBar.vue
index 0083c21f22..160edbc37d 100644
--- a/src/components/Settings/SearchBar.vue
+++ b/src/components/Settings/SearchBar.vue
@@ -18,6 +18,7 @@
diff --git a/src/utils/ConfigHelpers.js b/src/utils/ConfigHelpers.js
index 97003b5798..a1848b6610 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();
+};
diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json
index 73987ef7aa..866154538b 100644
--- a/src/utils/ConfigSchema.json
+++ b/src/utils/ConfigSchema.json
@@ -364,6 +364,10 @@
"default": "newtab",
"description": "Opening method, when item is clicked"
},
+ "hotkey": {
+ "type": "number",
+ "description": "A numeric shortcut key, between 0 and 9. Useful for quickly launching frequently used applications"
+ },
"color": {
"type": "string",
"description": "A custom fill color of the item"