diff options
Diffstat (limited to 'swayidle')
-rw-r--r-- | swayidle/main.c | 8 | ||||
-rw-r--r-- | swayidle/meson.build | 24 |
2 files changed, 20 insertions, 12 deletions
diff --git a/swayidle/main.c b/swayidle/main.c index 7d0f23f4..2b185949 100644 --- a/swayidle/main.c +++ b/swayidle/main.c | |||
@@ -18,10 +18,10 @@ | |||
18 | #include "config.h" | 18 | #include "config.h" |
19 | #include "idle-client-protocol.h" | 19 | #include "idle-client-protocol.h" |
20 | #include "list.h" | 20 | #include "list.h" |
21 | #ifdef SWAY_IDLE_HAS_SYSTEMD | 21 | #if HAVE_SYSTEMD |
22 | #include <systemd/sd-bus.h> | 22 | #include <systemd/sd-bus.h> |
23 | #include <systemd/sd-login.h> | 23 | #include <systemd/sd-login.h> |
24 | #elif defined(SWAY_IDLE_HAS_ELOGIND) | 24 | #elif HAVE_ELOGIND |
25 | #include <elogind/sd-bus.h> | 25 | #include <elogind/sd-bus.h> |
26 | #include <elogind/sd-login.h> | 26 | #include <elogind/sd-login.h> |
27 | #endif | 27 | #endif |
@@ -66,7 +66,7 @@ static void cmd_exec(char *param) { | |||
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #if defined(SWAY_IDLE_HAS_SYSTEMD) || defined(SWAY_IDLE_HAS_ELOGIND) | 69 | #if HAVE_SYSTEMD || HAVE_ELOGIND |
70 | static int lock_fd = -1; | 70 | static int lock_fd = -1; |
71 | static int ongoing_fd = -1; | 71 | static int ongoing_fd = -1; |
72 | static struct sd_bus *bus = NULL; | 72 | static struct sd_bus *bus = NULL; |
@@ -414,7 +414,7 @@ int main(int argc, char *argv[]) { | |||
414 | } | 414 | } |
415 | 415 | ||
416 | bool should_run = state.timeout_cmds->length > 0; | 416 | bool should_run = state.timeout_cmds->length > 0; |
417 | #if defined(SWAY_IDLE_HAS_SYSTEMD) || defined(SWAY_IDLE_HAS_ELOGIND) | 417 | #if HAVE_SYSTEMD || HAVE_ELOGIND |
418 | if (state.lock_cmd) { | 418 | if (state.lock_cmd) { |
419 | should_run = true; | 419 | should_run = true; |
420 | setup_sleep_listener(); | 420 | setup_sleep_listener(); |
diff --git a/swayidle/meson.build b/swayidle/meson.build index 6c3ac119..79d2c5c4 100644 --- a/swayidle/meson.build +++ b/swayidle/meson.build | |||
@@ -1,18 +1,26 @@ | |||
1 | threads = dependency('threads') | 1 | threads = dependency('threads') |
2 | 2 | ||
3 | swayidle_deps = [ | ||
4 | client_protos, | ||
5 | pixman, | ||
6 | wayland_client, | ||
7 | wayland_server, | ||
8 | wlroots, | ||
9 | ] | ||
10 | |||
11 | if systemd.found() | ||
12 | swayidle_deps += systemd | ||
13 | endif | ||
14 | if elogind.found() | ||
15 | swayidle_deps += elogind | ||
16 | endif | ||
17 | |||
3 | executable( | 18 | executable( |
4 | 'swayidle', [ | 19 | 'swayidle', [ |
5 | 'main.c', | 20 | 'main.c', |
6 | ], | 21 | ], |
7 | include_directories: [sway_inc], | 22 | include_directories: [sway_inc], |
8 | dependencies: [ | 23 | dependencies: swayidle_deps, |
9 | client_protos, | ||
10 | pixman, | ||
11 | wayland_client, | ||
12 | wayland_server, | ||
13 | wlroots, | ||
14 | swayidle_deps, | ||
15 | ], | ||
16 | link_with: [lib_sway_common, lib_sway_client], | 24 | link_with: [lib_sway_common, lib_sway_client], |
17 | install_rpath : rpathdir, | 25 | install_rpath : rpathdir, |
18 | install: true | 26 | install: true |