aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--swaybar/CMakeLists.txt36
-rw-r--r--swaybar/main.c20
3 files changed, 57 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fce820fc..1298a2ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,7 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
37add_subdirectory(swaybg) 37add_subdirectory(swaybg)
38add_subdirectory(swaymsg) 38add_subdirectory(swaymsg)
39add_subdirectory(swaygrab) 39add_subdirectory(swaygrab)
40add_subdirectory(swaybar)
40 41
41find_package(XKBCommon REQUIRED) 42find_package(XKBCommon REQUIRED)
42find_package(WLC REQUIRED) 43find_package(WLC REQUIRED)
diff --git a/swaybar/CMakeLists.txt b/swaybar/CMakeLists.txt
new file mode 100644
index 00000000..12dd40c6
--- /dev/null
+++ b/swaybar/CMakeLists.txt
@@ -0,0 +1,36 @@
1project(swaybar)
2
3find_package(Wayland REQUIRED)
4find_package(Cairo REQUIRED)
5find_package(Pango REQUIRED)
6
7include(Wayland)
8set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../bin/)
9WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell "${PROJECT_SOURCE_DIR}/../protocols/xdg-shell.xml" xdg-shell)
10WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell "${PROJECT_SOURCE_DIR}/../protocols/desktop-shell.xml" desktop-shell)
11
12include_directories(
13 ${WAYLAND_CLIENT_INCLUDE_DIR}
14 ${CAIRO_INCLUDE_DIRS}
15 ${PANGO_INCLUDE_DIRS}
16 ${CMAKE_CURRENT_BINARY_DIR}
17)
18
19FILE(GLOB sources ${PROJECT_SOURCE_DIR}/*.c)
20FILE(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c)
21FILE(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c)
22
23add_executable(swaybar
24 ${sources}
25 ${wl_sources}
26 ${common}
27 ${proto-xdg-shell}
28 ${proto-desktop-shell}
29)
30
31TARGET_LINK_LIBRARIES(swaybar ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES} m)
32
33install(
34 TARGETS swaybar
35 RUNTIME DESTINATION bin
36 COMPONENT runtime)
diff --git a/swaybar/main.c b/swaybar/main.c
new file mode 100644
index 00000000..49ba7a78
--- /dev/null
+++ b/swaybar/main.c
@@ -0,0 +1,20 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include "client/registry.h"
4#include "client/window.h"
5#include "log.h"
6
7struct registry *registry;
8struct window *window;
9
10void sway_terminate(void) {
11 window_teardown(window);
12 registry_teardown(registry);
13 exit(EXIT_FAILURE);
14}
15
16int main(int argc, char **argv) {
17 init_log(L_INFO);
18 sway_log(L_INFO, "Hello world!");
19 return 0;
20}