mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-02 01:40:13 -05:00
osc: kitty notifications: add support for XDG sound names
This commit is contained in:
parent
6349262491
commit
84d36606cb
6 changed files with 31 additions and 9 deletions
11
osc.c
11
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%s",
|
||||
"\033]99;i=%s:p=?;p=%s:a=%s:o=%s:u=%s:c=1:w=1:s=silent,xdg-names%s",
|
||||
reply_id, p_caps, a_caps, when_caps, u_caps, terminator);
|
||||
|
||||
xassert(n < sizeof(reply));
|
||||
|
|
@ -964,6 +964,15 @@ kitty_notification(struct terminal *term, char *string)
|
|||
|
||||
if (sound_name != NULL) {
|
||||
notif->muted = streq(sound_name, "silent");
|
||||
|
||||
if (notif->muted || streq(sound_name, "system")) {
|
||||
free(notif->sound_name);
|
||||
notif->sound_name = NULL;
|
||||
} else {
|
||||
free(notif->sound_name);
|
||||
notif->sound_name = sound_name;
|
||||
sound_name = NULL; /* Prevent double free */
|
||||
}
|
||||
}
|
||||
|
||||
/* Handled chunked payload - append to existing metadata */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue