MCPcopy Create free account
hub / github.com/Alexays/Waybar / setupAltFormatKeyForModule

Method setupAltFormatKeyForModule

src/bar.cpp:469–495  ·  view source on GitHub ↗

Converting string to button code rn as to avoid doing it later

Source from the content-addressed store, hash-verified

467
468// Converting string to button code rn as to avoid doing it later
469void waybar::Bar::setupAltFormatKeyForModule(const std::string& module_name) {
470 if (config.isMember(module_name)) {
471 Json::Value& module = config[module_name];
472 if (module.isMember("format-alt")) {
473 if (module.isMember("format-alt-click")) {
474 Json::Value& click = module["format-alt-click"];
475 if (click.isString()) {
476 if (click == "click-right") {
477 module["format-alt-click"] = 3U;
478 } else if (click == "click-middle") {
479 module["format-alt-click"] = 2U;
480 } else if (click == "click-backward") {
481 module["format-alt-click"] = 8U;
482 } else if (click == "click-forward") {
483 module["format-alt-click"] = 9U;
484 } else {
485 module["format-alt-click"] = 1U; // default click-left
486 }
487 } else {
488 module["format-alt-click"] = 1U;
489 }
490 } else {
491 module["format-alt-click"] = 1U;
492 }
493 }
494 }
495}
496
497void waybar::Bar::setupAltFormatKeyForModuleList(const char* module_list_name) {
498 if (config.isMember(module_list_name)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected