* Returns a nicely formatted keybind string from PaperWM * @param {String} key
(key)
| 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 |