aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-08-09 06:25:36 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-08-09 06:25:36 +0000
commitee9c76ded00de9beac698d2bd4771e8c1d966c6a (patch)
tree2b11fef4eb97a1117a1eb539ef9e431e91bcc2f4
parentdoc: foot.ini: document the Unicode ranges covered by the builtin glyphs (diff)
osc: kitty: update 's' to the latest spec
* The spec now defines a couple of "standard" names. Translate these to the freedesktop compliant names. * The query response no longer contains 'xdg-names', but instead list the supported standard names.
-rw-r--r--osc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/osc.c b/osc.c
index eba1850f..53597d0f 100644
--- a/osc.c
+++ b/osc.c
@@ -740,7 +740,7 @@ kitty_notification(struct terminal *term, char *string)
char reply[128];
int n = xsnprintf(
reply, sizeof(reply),
- "\033]99;i=%s:p=?;p=%s:a=%s:o=%s:u=%s:c=1:w=1:s=silent,xdg-names%s",
+ "\033]99;i=%s:p=?;p=%s:a=%s:o=%s:u=%s:c=1:w=1:s=system,silent,error,warn,warning,info,question%s",
reply_id, p_caps, a_caps, when_caps, u_caps, terminator);
xassert(n < sizeof(reply));
@@ -817,6 +817,22 @@ kitty_notification(struct terminal *term, char *string)
if (decoded != NULL) {
free(sound_name);
sound_name = decoded;
+
+ const char *translated_name = NULL;
+
+ if (streq(decoded, "error"))
+ translated_name = "dialog-error";
+ else if (streq(decoded, "warn") || streq(decoded, "warning"))
+ translated_name = "dialog-warning";
+ else if (streq(decoded, "info"))
+ translated_name = "dialog-information";
+ else if (streq(decoded, "question"))
+ translated_name = "dialog-question";
+
+ if (translated_name != NULL) {
+ free(sound_name);
+ sound_name = xstrdup(translated_name);
+ }
}
break;
}