summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Mykyta Holubakha <hilobakho@gmail.com>2016-04-24 20:35:21 +0300
committerLibravatar Mykyta Holubakha <hilobakho@gmail.com>2016-04-24 20:35:21 +0300
commit0f1cfdec617d122afbc87eb6466d5d2e5c348259 (patch)
tree929117e8a3276b240b59262e0809eb51c949eb42
parentFix line length calculation (diff)
downloadsway-0f1cfdec617d122afbc87eb6466d5d2e5c348259.tar.gz
sway-0f1cfdec617d122afbc87eb6466d5d2e5c348259.tar.zst
sway-0f1cfdec617d122afbc87eb6466d5d2e5c348259.zip
Renamed to pango_markup
-rw-r--r--include/bar/config.h2
-rw-r--r--include/config.h2
-rw-r--r--sway/commands.c16
-rw-r--r--sway/config.c2
-rw-r--r--sway/ipc-server.c2
-rw-r--r--sway/sway-bar.5.txt2
-rw-r--r--swaybar/config.c2
-rw-r--r--swaybar/ipc.c4
-rw-r--r--swaybar/render.c4
9 files changed, 18 insertions, 18 deletions
diff --git a/include/bar/config.h b/include/bar/config.h
index 27e0ec29..c0e3d2a7 100644
--- a/include/bar/config.h
+++ b/include/bar/config.h
@@ -20,7 +20,7 @@ struct box_colors {
20 */ 20 */
21struct config { 21struct config {
22 char *status_command; 22 char *status_command;
23 bool plaintext_markup; 23 bool pango_markup;
24 uint32_t position; 24 uint32_t position;
25 char *font; 25 char *font;
26 char *sep_symbol; 26 char *sep_symbol;
diff --git a/include/config.h b/include/config.h
index c6f63134..37b97665 100644
--- a/include/config.h
+++ b/include/config.h
@@ -116,7 +116,7 @@ struct bar_config {
116 enum desktop_shell_panel_position position; 116 enum desktop_shell_panel_position position;
117 list_t *bindings; 117 list_t *bindings;
118 char *status_command; 118 char *status_command;
119 bool plaintext_markup; 119 bool pango_markup;
120 char *swaybar_command; 120 char *swaybar_command;
121 char *font; 121 char *font;
122 int height; // -1 not defined 122 int height; // -1 not defined
diff --git a/sway/commands.c b/sway/commands.c
index 3c312ae8..08d3f09d 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -103,7 +103,7 @@ static sway_cmd bar_cmd_id;
103static sway_cmd bar_cmd_position; 103static sway_cmd bar_cmd_position;
104static sway_cmd bar_cmd_separator_symbol; 104static sway_cmd bar_cmd_separator_symbol;
105static sway_cmd bar_cmd_status_command; 105static sway_cmd bar_cmd_status_command;
106static sway_cmd bar_cmd_plaintext_markup; 106static sway_cmd bar_cmd_pango_markup;
107static sway_cmd bar_cmd_strip_workspace_numbers; 107static sway_cmd bar_cmd_strip_workspace_numbers;
108static sway_cmd bar_cmd_swaybar_command; 108static sway_cmd bar_cmd_swaybar_command;
109static sway_cmd bar_cmd_tray_output; 109static sway_cmd bar_cmd_tray_output;
@@ -2758,24 +2758,24 @@ static struct cmd_results *bar_cmd_status_command(int argc, char **argv) {
2758 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 2758 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
2759} 2759}
2760 2760
2761static struct cmd_results *bar_cmd_plaintext_markup(int argc, char **argv) { 2761static struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
2762 struct cmd_results *error = NULL; 2762 struct cmd_results *error = NULL;
2763 if ((error = checkarg(argc, "plaintext_markup", EXPECTED_EQUAL_TO, 1))) { 2763 if ((error = checkarg(argc, "pango_markup", EXPECTED_EQUAL_TO, 1))) {
2764 return error; 2764 return error;
2765 } 2765 }
2766 2766
2767 if (!config->current_bar) { 2767 if (!config->current_bar) {
2768 return cmd_results_new(CMD_FAILURE, "plaintext_markup", "No bar defined."); 2768 return cmd_results_new(CMD_FAILURE, "pango_markup", "No bar defined.");
2769 } 2769 }
2770 2770
2771 if (strcasecmp("pango", argv[0]) == 0) { 2771 if (strcasecmp("pango", argv[0]) == 0) {
2772 config->current_bar->plaintext_markup = true; 2772 config->current_bar->pango_markup = true;
2773 sway_log(L_DEBUG, "Enabling pango markup for bar: %s", config->current_bar->id); 2773 sway_log(L_DEBUG, "Enabling pango markup for bar: %s", config->current_bar->id);
2774 } else if (strcasecmp("none", argv[0]) == 0) { 2774 } else if (strcasecmp("none", argv[0]) == 0) {
2775 config->current_bar->plaintext_markup = false; 2775 config->current_bar->pango_markup = false;
2776 sway_log(L_DEBUG, "Disabling pango markup for bar: %s", config->current_bar->id); 2776 sway_log(L_DEBUG, "Disabling pango markup for bar: %s", config->current_bar->id);
2777 } else { 2777 } else {
2778 error = cmd_results_new(CMD_INVALID, "plaintext_markup", "Invalid value %s", argv[0]); 2778 error = cmd_results_new(CMD_INVALID, "pango_markup", "Invalid value %s", argv[0]);
2779 return error; 2779 return error;
2780 } 2780 }
2781 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 2781 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -2885,7 +2885,7 @@ static struct cmd_handler bar_handlers[] = {
2885 { "mode", bar_cmd_mode }, 2885 { "mode", bar_cmd_mode },
2886 { "modifier", bar_cmd_modifier }, 2886 { "modifier", bar_cmd_modifier },
2887 { "output", bar_cmd_output }, 2887 { "output", bar_cmd_output },
2888 { "plaintext_markup", bar_cmd_plaintext_markup }, 2888 { "pango_markup", bar_cmd_pango_markup },
2889 { "position", bar_cmd_position }, 2889 { "position", bar_cmd_position },
2890 { "separator_symbol", bar_cmd_separator_symbol }, 2890 { "separator_symbol", bar_cmd_separator_symbol },
2891 { "status_command", bar_cmd_status_command }, 2891 { "status_command", bar_cmd_status_command },
diff --git a/sway/config.c b/sway/config.c
index 3c14032b..ebcee95b 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -1022,7 +1022,7 @@ struct bar_config *default_bar_config(void) {
1022 bar->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM; 1022 bar->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM;
1023 bar->bindings = create_list(); 1023 bar->bindings = create_list();
1024 bar->status_command = strdup("while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done"); 1024 bar->status_command = strdup("while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done");
1025 bar->plaintext_markup = true; 1025 bar->pango_markup = true;
1026 bar->swaybar_command = NULL; 1026 bar->swaybar_command = NULL;
1027 bar->font = NULL; 1027 bar->font = NULL;
1028 bar->height = -1; 1028 bar->height = -1;
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 0ab6af49..4d9264e8 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -600,7 +600,7 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) {
600 json_object_object_add(json, "strip_workspace_numbers", json_object_new_boolean(bar->strip_workspace_numbers)); 600 json_object_object_add(json, "strip_workspace_numbers", json_object_new_boolean(bar->strip_workspace_numbers));
601 json_object_object_add(json, "binding_mode_indicator", json_object_new_boolean(bar->binding_mode_indicator)); 601 json_object_object_add(json, "binding_mode_indicator", json_object_new_boolean(bar->binding_mode_indicator));
602 json_object_object_add(json, "verbose", json_object_new_boolean(bar->verbose)); 602 json_object_object_add(json, "verbose", json_object_new_boolean(bar->verbose));
603 json_object_object_add(json, "plaintext_markup", json_object_new_boolean(bar->plaintext_markup)); 603 json_object_object_add(json, "pango_markup", json_object_new_boolean(bar->pango_markup));
604 604
605 json_object *colors = json_object_new_object(); 605 json_object *colors = json_object_new_object();
606 json_object_object_add(colors, "background", json_object_new_string(bar->colors.background)); 606 json_object_object_add(colors, "background", json_object_new_string(bar->colors.background));
diff --git a/sway/sway-bar.5.txt b/sway/sway-bar.5.txt
index 558a9564..25b59946 100644
--- a/sway/sway-bar.5.txt
+++ b/sway/sway-bar.5.txt
@@ -21,7 +21,7 @@ Commands
21**status_command** <status command>:: 21**status_command** <status command>::
22 Executes the bar _status command_ with _sh -c_. 22 Executes the bar _status command_ with _sh -c_.
23 23
24**plaintext_markup** <pango|none>:: 24**pango_markup** <pango|none>::
25 Enables or disables pango markup for plaintext statuslines. 25 Enables or disables pango markup for plaintext statuslines.
26 26
27**id** <bar_id>:: 27**id** <bar_id>::
diff --git a/swaybar/config.c b/swaybar/config.c
index 7ef9a07e..7bd22c91 100644
--- a/swaybar/config.c
+++ b/swaybar/config.c
@@ -46,7 +46,7 @@ char *parse_font(const char *font) {
46struct config *init_config() { 46struct config *init_config() {
47 struct config *config = calloc(1, sizeof(struct config)); 47 struct config *config = calloc(1, sizeof(struct config));
48 config->status_command = NULL; 48 config->status_command = NULL;
49 config->plaintext_markup = true; 49 config->pango_markup = true;
50 config->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM; 50 config->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM;
51 config->font = strdup("monospace 10"); 51 config->font = strdup("monospace 10");
52 config->mode = NULL; 52 config->mode = NULL;
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index 0446f38a..dacee4c2 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -27,7 +27,7 @@ static void ipc_parse_config(struct config *config, const char *payload) {
27 json_object_object_get_ex(bar_config, "separator_symbol", &sep_symbol); 27 json_object_object_get_ex(bar_config, "separator_symbol", &sep_symbol);
28 json_object_object_get_ex(bar_config, "colors", &colors); 28 json_object_object_get_ex(bar_config, "colors", &colors);
29 json_object_object_get_ex(bar_config, "outputs", &outputs); 29 json_object_object_get_ex(bar_config, "outputs", &outputs);
30 json_object_object_get_ex(bar_config, "plaintext_markup", &markup); 30 json_object_object_get_ex(bar_config, "pango_markup", &markup);
31 31
32 if (status_command) { 32 if (status_command) {
33 free(config->status_command); 33 free(config->status_command);
@@ -65,7 +65,7 @@ static void ipc_parse_config(struct config *config, const char *payload) {
65 } 65 }
66 66
67 if (markup) { 67 if (markup) {
68 config->plaintext_markup = json_object_get_boolean(markup); 68 config->pango_markup = json_object_get_boolean(markup);
69 } 69 }
70 70
71 // free previous outputs list 71 // free previous outputs list
diff --git a/swaybar/render.c b/swaybar/render.c
index b9ef2242..273bd4f0 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -278,9 +278,9 @@ void render(struct output *output, struct config *config, struct status_line *li
278 int width, height; 278 int width, height;
279 279
280 if (line->protocol == TEXT) { 280 if (line->protocol == TEXT) {
281 get_text_size(window->cairo, window->font, &width, &height, config->plaintext_markup, "%s", line->text_line); 281 get_text_size(window->cairo, window->font, &width, &height, config->pango_markup, "%s", line->text_line);
282 cairo_move_to(cairo, window->width - margin - width, margin); 282 cairo_move_to(cairo, window->width - margin - width, margin);
283 pango_printf(window->cairo, window->font, config->plaintext_markup, "%s", line->text_line); 283 pango_printf(window->cairo, window->font, config->pango_markup, "%s", line->text_line);
284 } else if (line->protocol == I3BAR && line->block_line) { 284 } else if (line->protocol == I3BAR && line->block_line) {
285 double pos = window->width - 0.5; 285 double pos = window->width - 0.5;
286 bool edge = true; 286 bool edge = true;