MCPcopy Index your code
hub / github.com/paperwm/PaperWM / getKeybindString

Method getKeybindString

topbar.js:424–440  ·  view source on GitHub ↗

* Returns a nicely formatted keybind string from PaperWM * @param {String} key

(key)

Source from the content-addressed store, hash-verified

422 * @param {String} key
423 */
424 getKeybindString(key) {
425 // get first keybind
426 try {
427 let kb = gsettings.get_child('keybindings').get_strv(key)[0]
428 .replace(/[<>]/g, ' ')
429 .trim()
430 .replace(/\s+/g, '+');
431
432 // empty
433 if (kb.length === 0) {
434 return '';
435 }
436 return `\n<i>(${kb})</i>`;
437 } catch (error) {
438 return '';
439 }
440 }
441 }
442);
443

Callers 2

markupMethod · 0.80
markupMethod · 0.80

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected