aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--config21
-rw-r--r--sway/handlers.c6
-rw-r--r--swaybar/main.c36
-rw-r--r--wallpaper.jpgbin0 -> 2458443 bytes
5 files changed, 61 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94f2ab29..109b233a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,4 +119,10 @@ install(
119 COMPONENT data 119 COMPONENT data
120) 120)
121 121
122install(
123 FILES ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper.jpg
124 DESTINATION share/sway
125 COMPONENT data
126)
127
122feature_summary(WHAT ALL) 128feature_summary(WHAT ALL)
diff --git a/config b/config
index 2bb37f4f..f7e9e751 100644
--- a/config
+++ b/config
@@ -16,6 +16,15 @@ set $term urxvt
16# Your preferred application launcher 16# Your preferred application launcher
17set $menu dmenu_run 17set $menu dmenu_run
18 18
19### Output configuration
20#
21# Default wallpaper - CC-BY-NC from Netzlemming http://netzlemming.deviantart.com/art/Field-of-Barley-05240017-307176737
22output * bg /usr/share/sway/wallpaper.jpg fill
23#
24# Example output configuration:
25#
26# output HDMI-A-1 resolution 1920x1080 position 1920,0
27
19### Key bindings 28### Key bindings
20# 29#
21# Basics: 30# Basics:
@@ -130,3 +139,15 @@ set $menu dmenu_run
130 # Show the next scratchpad window or hide the focused scratchpad window. 139 # Show the next scratchpad window or hide the focused scratchpad window.
131 # If there are multiple scratchpad windows, this command cycles through them. 140 # If there are multiple scratchpad windows, this command cycles through them.
132 bindsym $mod+minus scratchpad show 141 bindsym $mod+minus scratchpad show
142
143#
144# Status Bar:
145#
146bar {
147 position top
148 colors {
149 statusline #ffffff
150 background #323232
151 inactive_workspace #32323200 #32323200 #5c5c5c
152 }
153}
diff --git a/sway/handlers.c b/sway/handlers.c
index b8bd9eff..6c6d0e60 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -252,8 +252,12 @@ static void handle_view_destroyed(wlc_handle handle) {
252 } 252 }
253 253
254 if (view) { 254 if (view) {
255 swayc_t *parent = destroy_view(view); 255 bool fullscreen = swayc_is_fullscreen(view);
256 remove_view_from_scratchpad(view); 256 remove_view_from_scratchpad(view);
257 swayc_t *parent = destroy_view(view);
258 if (fullscreen) {
259 parent->fullscreen = NULL;
260 }
257 arrange_windows(parent, -1, -1); 261 arrange_windows(parent, -1, -1);
258 } else { 262 } else {
259 // Is it unmanaged? 263 // Is it unmanaged?
diff --git a/swaybar/main.c b/swaybar/main.c
index 49aa08cd..05c1fd75 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -75,6 +75,7 @@ char *output, *status_command;
75struct registry *registry; 75struct registry *registry;
76struct window *window; 76struct window *window;
77bool dirty = true; 77bool dirty = true;
78char *separator_symbol = NULL;
78typedef enum {UNDEF, TEXT, I3BAR} command_protocol; 79typedef enum {UNDEF, TEXT, I3BAR} command_protocol;
79command_protocol protocol = UNDEF; 80command_protocol protocol = UNDEF;
80 81
@@ -289,7 +290,7 @@ void bar_ipc_init(int outputi, const char *bar_id) {
289 json_object *bar_config = json_tokener_parse(res); 290 json_object *bar_config = json_tokener_parse(res);
290 json_object *tray_output, *mode, *hidden_state, *position, *_status_command; 291 json_object *tray_output, *mode, *hidden_state, *position, *_status_command;
291 json_object *font, *bar_height, *workspace_buttons, *strip_workspace_numbers; 292 json_object *font, *bar_height, *workspace_buttons, *strip_workspace_numbers;
292 json_object *binding_mode_indicator, *verbose, *_colors; 293 json_object *binding_mode_indicator, *verbose, *_colors, *sep_symbol;
293 json_object_object_get_ex(bar_config, "tray_output", &tray_output); 294 json_object_object_get_ex(bar_config, "tray_output", &tray_output);
294 json_object_object_get_ex(bar_config, "mode", &mode); 295 json_object_object_get_ex(bar_config, "mode", &mode);
295 json_object_object_get_ex(bar_config, "hidden_state", &hidden_state); 296 json_object_object_get_ex(bar_config, "hidden_state", &hidden_state);
@@ -301,6 +302,7 @@ void bar_ipc_init(int outputi, const char *bar_id) {
301 json_object_object_get_ex(bar_config, "strip_workspace_numbers", &strip_workspace_numbers); 302 json_object_object_get_ex(bar_config, "strip_workspace_numbers", &strip_workspace_numbers);
302 json_object_object_get_ex(bar_config, "binding_mode_indicator", &binding_mode_indicator); 303 json_object_object_get_ex(bar_config, "binding_mode_indicator", &binding_mode_indicator);
303 json_object_object_get_ex(bar_config, "verbose", &verbose); 304 json_object_object_get_ex(bar_config, "verbose", &verbose);
305 json_object_object_get_ex(bar_config, "separator_symbol", &sep_symbol);
304 json_object_object_get_ex(bar_config, "colors", &_colors); 306 json_object_object_get_ex(bar_config, "colors", &_colors);
305 307
306 // TODO: More of these options 308 // TODO: More of these options
@@ -317,6 +319,10 @@ void bar_ipc_init(int outputi, const char *bar_id) {
317 window->font = parse_font(json_object_get_string(font)); 319 window->font = parse_font(json_object_get_string(font));
318 } 320 }
319 321
322 if (sep_symbol) {
323 separator_symbol = strdup(json_object_get_string(sep_symbol));
324 }
325
320 if (bar_height) { 326 if (bar_height) {
321 int width, height; 327 int width, height;
322 get_text_size(window, &width, &height, "Test string for measuring purposes"); 328 get_text_size(window, &width, &height, "Test string for measuring purposes");
@@ -438,7 +444,7 @@ void render_sharp_line(cairo_t *cairo, uint32_t color, double x, double y, doubl
438} 444}
439 445
440void render_block(struct status_block *block, double *x, bool edge) { 446void render_block(struct status_block *block, double *x, bool edge) {
441 int width, height; 447 int width, height, sep_width;
442 get_text_size(window, &width, &height, "%s", block->full_text); 448 get_text_size(window, &width, &height, "%s", block->full_text);
443 449
444 int textwidth = width; 450 int textwidth = width;
@@ -462,6 +468,13 @@ void render_block(struct status_block *block, double *x, bool edge) {
462 468
463 // Add separator 469 // Add separator
464 if (!edge) { 470 if (!edge) {
471 if (separator_symbol) {
472 get_text_size(window, &sep_width, &height, "%s", separator_symbol);
473 if (sep_width > block->separator_block_width) {
474 block->separator_block_width = sep_width + margin * 2;
475 }
476 }
477
465 *x -= block->separator_block_width; 478 *x -= block->separator_block_width;
466 } else { 479 } else {
467 *x -= margin; 480 *x -= margin;
@@ -535,14 +548,23 @@ void render_block(struct status_block *block, double *x, bool edge) {
535 pos += block->border_right; 548 pos += block->border_right;
536 } 549 }
537 550
551 sway_log(L_DEBUG, "%s", separator_symbol);
552
538 // render separator 553 // render separator
539 // TODO: Handle custom separator
540 if (!edge && block->separator) { 554 if (!edge && block->separator) {
541 cairo_set_source_u32(window->cairo, colors.separator); 555 cairo_set_source_u32(window->cairo, colors.separator);
542 cairo_set_line_width(window->cairo, 1); 556 if (separator_symbol) {
543 cairo_move_to(window->cairo, pos + block->separator_block_width/2, margin); 557 offset = pos + (block->separator_block_width - sep_width) / 2;
544 cairo_line_to(window->cairo, pos + block->separator_block_width/2, window->height - margin); 558 cairo_move_to(window->cairo, offset, margin);
545 cairo_stroke(window->cairo); 559 pango_printf(window, "%s", separator_symbol);
560 } else {
561 cairo_set_line_width(window->cairo, 1);
562 cairo_move_to(window->cairo, pos + block->separator_block_width/2,
563 margin);
564 cairo_line_to(window->cairo, pos + block->separator_block_width/2,
565 window->height - margin);
566 cairo_stroke(window->cairo);
567 }
546 } 568 }
547 569
548} 570}
diff --git a/wallpaper.jpg b/wallpaper.jpg
new file mode 100644
index 00000000..65a167f0
--- /dev/null
+++ b/wallpaper.jpg
Binary files differ