summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-04-14 00:27:47 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2019-04-14 12:41:59 +0300
commit6961bf2e4ce2c116e41a8db158691f6c993707ce (patch)
treea381146599a5f19e565006cafeb23edc04247d2b /include
parentswaynag: fix pointer management (diff)
downloadsway-6961bf2e4ce2c116e41a8db158691f6c993707ce.tar.gz
sway-6961bf2e4ce2c116e41a8db158691f6c993707ce.tar.zst
sway-6961bf2e4ce2c116e41a8db158691f6c993707ce.zip
Spawn swaynag as a wayland client
This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done
Diffstat (limited to 'include')
-rw-r--r--include/sway/swaynag.h8
-rw-r--r--include/util.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/include/sway/swaynag.h b/include/sway/swaynag.h
index 5a178739..74d9ea18 100644
--- a/include/sway/swaynag.h
+++ b/include/sway/swaynag.h
@@ -1,9 +1,12 @@
1#ifndef _SWAY_SWAYNAG_H 1#ifndef _SWAY_SWAYNAG_H
2#define _SWAY_SWAYNAG_H 2#define _SWAY_SWAYNAG_H
3#include <wayland-server-core.h>
3 4
4struct swaynag_instance { 5struct swaynag_instance {
6 struct wl_client *client;
7 struct wl_listener client_destroy;
8
5 const char *args; 9 const char *args;
6 pid_t pid;
7 int fd[2]; 10 int fd[2];
8 bool detailed; 11 bool detailed;
9}; 12};
@@ -15,9 +18,6 @@ struct swaynag_instance {
15bool swaynag_spawn(const char *swaynag_command, 18bool swaynag_spawn(const char *swaynag_command,
16 struct swaynag_instance *swaynag); 19 struct swaynag_instance *swaynag);
17 20
18// Kill the swaynag instance
19void swaynag_kill(struct swaynag_instance *swaynag);
20
21// Write a log message to swaynag->fd[1]. This will fail when swaynag->detailed 21// Write a log message to swaynag->fd[1]. This will fail when swaynag->detailed
22// is false. 22// is false.
23void swaynag_log(const char *swaynag_command, struct swaynag_instance *swaynag, 23void swaynag_log(const char *swaynag_command, struct swaynag_instance *swaynag,
diff --git a/include/util.h b/include/util.h
index 6a668fd6..6d9454e0 100644
--- a/include/util.h
+++ b/include/util.h
@@ -32,4 +32,6 @@ float parse_float(const char *value);
32 32
33const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel); 33const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel);
34 34
35bool set_cloexec(int fd, bool cloexec);
36
35#endif 37#endif