438 GError *error = NULL;
439 GString *error_msg = g_string_new(
"");
442 char *keystr = g_strdup(b->
binding);
446 const char *
const sep =
",";
447 for (
char *entry = strtok_r(keystr, sep, &sp); entry != NULL;
448 entry = strtok_r(NULL, sep, &sp)) {
451 GUINT_TO_POINTER(b->
id), NULL,
452 NK_BINDINGS_ADD_FLAG_NONE,
454 if (error->code == NK_BINDINGS_ERROR_ALREADY_REGISTERED &&
455 error->domain == NK_BINDINGS_ERROR) {
456 char *str = g_markup_printf_escaped(
457 "Failed to set binding <i>%s</i> for: <i>%s (%s)</i>:\n\t<span "
458 "size=\"smaller\" style=\"italic\">Binding `%s` is already "
460 "\tExecute <b>rofi -list-keybindings</b> to get the current list "
461 "of configured bindings.</span>\n",
463 g_string_append(error_msg, str);
466 char *str = g_markup_printf_escaped(
467 "Failed to set binding <i>%s</i> for: <i>%s (%s)</i>:\n\t<span "
468 "size=\"smaller\" style=\"italic\">%s</span>\n",
470 g_string_append(error_msg, str);
473 g_clear_error(&error);
479 if (error_msg->len > 0) {
490 GSIZE_TO_POINTER(j), NULL,
491 NK_BINDINGS_ADD_FLAG_NONE,
496 g_string_free(error_msg, TRUE);
void rofi_add_error_message(GString *str)