mirror of
https://github.com/swaywm/sway.git
synced 2025-11-24 06:59:51 -05:00
Spawn swaynag as a wayland client
This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done
This commit is contained in:
parent
8c69da11bb
commit
6961bf2e4c
8 changed files with 147 additions and 71 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
|
|
@ -488,24 +487,6 @@ static void handle_swaybg_client_destroy(struct wl_listener *listener,
|
|||
config->swaybg_client = NULL;
|
||||
}
|
||||
|
||||
static bool set_cloexec(int fd, bool cloexec) {
|
||||
int flags = fcntl(fd, F_GETFD);
|
||||
if (flags == -1) {
|
||||
sway_log_errno(SWAY_ERROR, "fcntl failed");
|
||||
return false;
|
||||
}
|
||||
if (cloexec) {
|
||||
flags = flags | FD_CLOEXEC;
|
||||
} else {
|
||||
flags = flags & ~FD_CLOEXEC;
|
||||
}
|
||||
if (fcntl(fd, F_SETFD, flags) == -1) {
|
||||
sway_log_errno(SWAY_ERROR, "fcntl failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool _spawn_swaybg(char **command) {
|
||||
if (config->swaybg_client != NULL) {
|
||||
wl_client_destroy(config->swaybg_client);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue