diff options
-rw-r--r-- | CMakeLists.txt | 49 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | sway/config.c | 6 |
3 files changed, 52 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a9ffde9..31e79ca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -41,16 +41,23 @@ add_definitions(-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\") | |||
41 | string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) | 41 | string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) |
42 | add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") | 42 | add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") |
43 | 43 | ||
44 | find_package(Cairo REQUIRED) | 44 | option(enable-swaylock "Enables the swaylock utility" YES) |
45 | option(enable-swaybg "Enables the wallpaper utility" YES) | ||
46 | option(enable-swaybar "Enables the swaybar utility" YES) | ||
47 | option(enable-swaygrab "Enables the swaygrab utility" YES) | ||
48 | option(enable-swaymsg "Enables the swaymsg utility" YES) | ||
49 | |||
45 | find_package(JsonC REQUIRED) | 50 | find_package(JsonC REQUIRED) |
46 | find_package(PCRE REQUIRED) | 51 | find_package(PCRE REQUIRED) |
47 | find_package(Pango REQUIRED) | ||
48 | find_package(WLC REQUIRED) | 52 | find_package(WLC REQUIRED) |
49 | find_package(Wayland REQUIRED) | 53 | find_package(Wayland REQUIRED) |
50 | find_package(XKBCommon REQUIRED) | 54 | find_package(XKBCommon REQUIRED) |
51 | find_package(GdkPixbuf REQUIRED) | 55 | find_package(Cairo) |
52 | find_package(PAM REQUIRED) | 56 | find_package(Pango) |
57 | find_package(GdkPixbuf) | ||
58 | find_package(PAM) | ||
53 | 59 | ||
60 | include(FeatureSummary) | ||
54 | include(Manpage) | 61 | include(Manpage) |
55 | 62 | ||
56 | include_directories(include) | 63 | include_directories(include) |
@@ -60,14 +67,38 @@ add_subdirectory(common) | |||
60 | add_subdirectory(wayland) | 67 | add_subdirectory(wayland) |
61 | 68 | ||
62 | add_subdirectory(sway) | 69 | add_subdirectory(sway) |
63 | add_subdirectory(swaybg) | 70 | if(enable-swaybg) |
64 | add_subdirectory(swaymsg) | 71 | if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) |
65 | add_subdirectory(swaygrab) | 72 | add_subdirectory(swaybg) |
66 | add_subdirectory(swaybar) | 73 | else() |
67 | add_subdirectory(swaylock) | 74 | message(WARNING "Not building swaybg - cairo, pango, and gdk-pixbuf are required.") |
75 | endif() | ||
76 | endif() | ||
77 | if(enable-swaymsg) | ||
78 | add_subdirectory(swaymsg) | ||
79 | endif() | ||
80 | if(enable-swaygrab) | ||
81 | add_subdirectory(swaygrab) | ||
82 | endif() | ||
83 | if(enable-swaybar) | ||
84 | if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) | ||
85 | add_subdirectory(swaybar) | ||
86 | else() | ||
87 | message(WARNING "Not building swaybar - cairo, pango, and gdk-pixbuf are required.") | ||
88 | endif() | ||
89 | endif() | ||
90 | if(enable-swaylock) | ||
91 | if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND AND PAM_FOUND) | ||
92 | add_subdirectory(swaylock) | ||
93 | else() | ||
94 | message(WARNING "Not building swaylock - cairo, pango, gdk-pixbuf, and PAM are required.") | ||
95 | endif() | ||
96 | endif() | ||
68 | 97 | ||
69 | install( | 98 | install( |
70 | FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop | 99 | FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop |
71 | DESTINATION share/wayland-sessions | 100 | DESTINATION share/wayland-sessions |
72 | COMPONENT data | 101 | COMPONENT data |
73 | ) | 102 | ) |
103 | |||
104 | feature_summary(WHAT ALL) | ||
@@ -41,10 +41,14 @@ Install dependencies: | |||
41 | * asciidoc | 41 | * asciidoc |
42 | * pcre | 42 | * pcre |
43 | * json-c | 43 | * json-c |
44 | * pango | 44 | * pango * |
45 | * cairo | 45 | * cairo * |
46 | * gdk-pixbuf2 | 46 | * gdk-pixbuf2 * |
47 | * pam | 47 | * pam ** |
48 | |||
49 | _\*Only required for swaybar, swaybg, and swaylock_ | ||
50 | |||
51 | _\*\*Only required for swaylock_ | ||
48 | 52 | ||
49 | Run these commands: | 53 | Run these commands: |
50 | 54 | ||
diff --git a/sway/config.c b/sway/config.c index faa3e387..4b1bf01a 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -53,7 +53,9 @@ static void free_bar(struct bar_config *bar) { | |||
53 | } | 53 | } |
54 | list_free(bar->bindings); | 54 | list_free(bar->bindings); |
55 | 55 | ||
56 | free_flat_list(bar->outputs); | 56 | if (bar->outputs) { |
57 | free_flat_list(bar->outputs); | ||
58 | } | ||
57 | free(bar); | 59 | free(bar); |
58 | } | 60 | } |
59 | 61 | ||
@@ -450,7 +452,7 @@ void load_swaybars(swayc_t *output, int output_idx) { | |||
450 | int j; | 452 | int j; |
451 | for (j = 0; j < bar->outputs->length; ++j) { | 453 | for (j = 0; j < bar->outputs->length; ++j) { |
452 | char *o = bar->outputs->items[j]; | 454 | char *o = bar->outputs->items[j]; |
453 | if (strcmp(o, "*") || strcasecmp(o, output->name)) { | 455 | if (!strcmp(o, "*") || !strcasecmp(o, output->name)) { |
454 | apply = true; | 456 | apply = true; |
455 | break; | 457 | break; |
456 | } | 458 | } |