foot/notify.h

42 lines
832 B
C
Raw Normal View History

#pragma once
#include <stdbool.h>
2024-07-23 06:59:46 +02:00
#include <unistd.h>
struct terminal;
enum notify_when {
2024-07-23 06:59:46 +02:00
/* First, so that it can be left out of initializer and still be
the default */
NOTIFY_ALWAYS,
2024-07-23 06:59:46 +02:00
NOTIFY_UNFOCUSED,
NOTIFY_INVISIBLE
};
enum notify_urgency {
2024-07-23 06:59:46 +02:00
/* First, so that it can be left out of initializer and still be
the default */
NOTIFY_URGENCY_NORMAL,
2024-07-23 06:59:46 +02:00
NOTIFY_URGENCY_LOW,
NOTIFY_URGENCY_CRITICAL,
};
2024-07-23 06:59:46 +02:00
struct notification {
char *id;
char *title;
char *body;
2024-07-23 06:59:46 +02:00
char *icon;
char *xdg_token;
enum notify_when when;
enum notify_urgency urgency;
bool focus;
bool report;
2024-07-23 06:59:46 +02:00
pid_t pid;
int stdout_fd;
};
2024-07-23 06:59:46 +02:00
bool notify_notify(const struct terminal *term, struct notification *notif);
void notify_free(struct terminal *term, struct notification *notif);