aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/bar
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bar')
-rw-r--r--sway/commands/bar/bind.c12
-rw-r--r--sway/commands/bar/binding_mode_indicator.c5
-rw-r--r--sway/commands/bar/colors.c10
-rw-r--r--sway/commands/bar/font.c4
-rw-r--r--sway/commands/bar/gaps.c6
-rw-r--r--sway/commands/bar/height.c4
-rw-r--r--sway/commands/bar/hidden_state.c7
-rw-r--r--sway/commands/bar/icon_theme.c6
-rw-r--r--sway/commands/bar/id.c8
-rw-r--r--sway/commands/bar/mode.c6
-rw-r--r--sway/commands/bar/modifier.c8
-rw-r--r--sway/commands/bar/output.c4
-rw-r--r--sway/commands/bar/pango_markup.c4
-rw-r--r--sway/commands/bar/position.c7
-rw-r--r--sway/commands/bar/separator_symbol.c5
-rw-r--r--sway/commands/bar/status_command.c5
-rw-r--r--sway/commands/bar/status_edge_padding.c4
-rw-r--r--sway/commands/bar/status_padding.c4
-rw-r--r--sway/commands/bar/strip_workspace_name.c5
-rw-r--r--sway/commands/bar/strip_workspace_numbers.c5
-rw-r--r--sway/commands/bar/swaybar_command.c5
-rw-r--r--sway/commands/bar/tray_bindsym.c10
-rw-r--r--sway/commands/bar/tray_output.c6
-rw-r--r--sway/commands/bar/tray_padding.c10
-rw-r--r--sway/commands/bar/workspace_buttons.c5
-rw-r--r--sway/commands/bar/wrap_scroll.c4
26 files changed, 74 insertions, 85 deletions
diff --git a/sway/commands/bar/bind.c b/sway/commands/bar/bind.c
index a4c65ec4..71adced8 100644
--- a/sway/commands/bar/bind.c
+++ b/sway/commands/bar/bind.c
@@ -16,13 +16,12 @@ static struct cmd_results *bar_cmd_bind(int argc, char **argv, bool code) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, command, "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
struct bar_binding *binding = calloc(1, sizeof(struct bar_binding));
if (!binding) {
- return cmd_results_new(CMD_FAILURE, command,
- "Unable to allocate bar binding");
+ return cmd_results_new(CMD_FAILURE, "Unable to allocate bar binding");
}
binding->release = false;
@@ -40,13 +39,12 @@ static struct cmd_results *bar_cmd_bind(int argc, char **argv, bool code) {
}
if (message) {
free_bar_binding(binding);
- error = cmd_results_new(CMD_INVALID, command, message);
+ error = cmd_results_new(CMD_INVALID, message);
free(message);
return error;
} else if (!binding->button) {
free_bar_binding(binding);
- return cmd_results_new(CMD_INVALID, command,
- "Unknown button %s", argv[0]);
+ return cmd_results_new(CMD_INVALID, "Unknown button %s", argv[0]);
}
const char *name = libevdev_event_code_get_name(EV_KEY, binding->button);
@@ -94,7 +92,7 @@ static struct cmd_results *bar_cmd_bind(int argc, char **argv, bool code) {
binding->release ? " - release" : "");
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
struct cmd_results *bar_cmd_bindcode(int argc, char **argv) {
diff --git a/sway/commands/bar/binding_mode_indicator.c b/sway/commands/bar/binding_mode_indicator.c
index b048b7b9..15acc309 100644
--- a/sway/commands/bar/binding_mode_indicator.c
+++ b/sway/commands/bar/binding_mode_indicator.c
@@ -11,8 +11,7 @@ struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE,
- "binding_mode_indicator", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
config->current_bar->binding_mode_indicator =
parse_boolean(argv[0], config->current_bar->binding_mode_indicator);
@@ -23,5 +22,5 @@ struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) {
wlr_log(WLR_DEBUG, "Disabling binding mode indicator on bar: %s",
config->current_bar->id);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/colors.c b/sway/commands/bar/colors.c
index ebf1e3e1..7921db0d 100644
--- a/sway/commands/bar/colors.c
+++ b/sway/commands/bar/colors.c
@@ -25,11 +25,11 @@ static struct cmd_results *parse_single_color(char **color,
if (!*color && !(*color = malloc(10))) {
return NULL;
}
- error = add_color(cmd_name, *color, argv[0]);
+ error = add_color(*color, argv[0]);
if (error) {
return error;
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
static struct cmd_results *parse_three_colors(char ***colors,
@@ -37,18 +37,18 @@ static struct cmd_results *parse_three_colors(char ***colors,
struct cmd_results *error = NULL;
if (argc != 3) {
return cmd_results_new(CMD_INVALID,
- cmd_name, "Requires exactly three color values");
+ "Command '%s' requires exactly three color values", cmd_name);
}
for (size_t i = 0; i < 3; i++) {
if (!*colors[i] && !(*(colors[i]) = malloc(10))) {
return NULL;
}
- error = add_color(cmd_name, *(colors[i]), argv[i]);
+ error = add_color(*(colors[i]), argv[i]);
if (error) {
return error;
}
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
struct cmd_results *bar_cmd_colors(int argc, char **argv) {
diff --git a/sway/commands/bar/font.c b/sway/commands/bar/font.c
index 2aa4e895..c6147e3d 100644
--- a/sway/commands/bar/font.c
+++ b/sway/commands/bar/font.c
@@ -10,12 +10,12 @@ struct cmd_results *bar_cmd_font(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "font", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
char *font = join_args(argv, argc);
free(config->current_bar->font);
config->current_bar->font = font;
wlr_log(WLR_DEBUG, "Settings font '%s' for bar: %s",
config->current_bar->font, config->current_bar->id);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/gaps.c b/sway/commands/bar/gaps.c
index f78f3742..fabe12fc 100644
--- a/sway/commands/bar/gaps.c
+++ b/sway/commands/bar/gaps.c
@@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_gaps(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "bar gaps", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
int top = 0, right = 0, bottom = 0, left = 0;
@@ -23,7 +23,7 @@ struct cmd_results *bar_cmd_gaps(int argc, char **argv) {
char *end;
int amount = strtol(argv[i], &end, 10);
if (strlen(end) && strcasecmp(end, "px") != 0) {
- return cmd_results_new(CMD_INVALID, "bar gaps",
+ return cmd_results_new(CMD_INVALID,
"Expected 'bar [<bar-id>] gaps <all> | <horizonal> "
"<vertical> | <top> <right> <bottom> <left>'");
}
@@ -56,5 +56,5 @@ struct cmd_results *bar_cmd_gaps(int argc, char **argv) {
ipc_event_barconfig_update(config->current_bar);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/height.c b/sway/commands/bar/height.c
index 18258526..a2e72533 100644
--- a/sway/commands/bar/height.c
+++ b/sway/commands/bar/height.c
@@ -10,11 +10,11 @@ struct cmd_results *bar_cmd_height(int argc, char **argv) {
}
int height = atoi(argv[0]);
if (height < 0) {
- return cmd_results_new(CMD_INVALID, "height",
+ return cmd_results_new(CMD_INVALID,
"Invalid height value: %s", argv[0]);
}
config->current_bar->height = height;
wlr_log(WLR_DEBUG, "Setting bar height to %d on bar: %s",
height, config->current_bar->id);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c
index 79eaf01c..3364ce70 100644
--- a/sway/commands/bar/hidden_state.c
+++ b/sway/commands/bar/hidden_state.c
@@ -20,8 +20,7 @@ static struct cmd_results *bar_set_hidden_state(struct bar_config *bar,
} else if (strcasecmp("show", hidden_state) == 0) {
bar->hidden_state = strdup("show");
} else {
- return cmd_results_new(CMD_INVALID, "hidden_state",
- "Invalid value %s", hidden_state);
+ return cmd_results_new(CMD_INVALID, "Invalid value %s", hidden_state);
}
if (strcmp(old_state, bar->hidden_state) != 0) {
if (!config->reading) {
@@ -44,7 +43,7 @@ struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) {
return error;
}
if (config->reading && argc > 1) {
- return cmd_results_new(CMD_INVALID, "hidden_state",
+ return cmd_results_new(CMD_INVALID,
"Unexpected value %s in config mode", argv[1]);
}
@@ -65,5 +64,5 @@ struct cmd_results *bar_cmd_hidden_state(int argc, char **argv) {
}
}
}
- return error ? error : cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return error ? error : cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/icon_theme.c b/sway/commands/bar/icon_theme.c
index 9d3b6040..2d16f748 100644
--- a/sway/commands/bar/icon_theme.c
+++ b/sway/commands/bar/icon_theme.c
@@ -13,16 +13,16 @@ struct cmd_results *bar_cmd_icon_theme(int argc, char **argv) {
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "tray_padding", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
wlr_log(WLR_DEBUG, "[Bar %s] Setting icon theme to %s",
config->current_bar->id, argv[0]);
free(config->current_bar->icon_theme);
config->current_bar->icon_theme = strdup(argv[0]);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
#else
- return cmd_results_new(CMD_INVALID, "icon_theme",
+ return cmd_results_new(CMD_INVALID,
"Sway has been compiled without tray support");
#endif
}
diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c
index 35509459..bef3023b 100644
--- a/sway/commands/bar/id.c
+++ b/sway/commands/bar/id.c
@@ -12,15 +12,15 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
const char *name = argv[0];
const char *oldname = config->current_bar->id;
if (strcmp(name, oldname) == 0) {
- return cmd_results_new(CMD_SUCCESS, NULL, NULL); // NOP
+ return cmd_results_new(CMD_SUCCESS, NULL); // NOP
} else if (strcmp(name, "id") == 0) {
- return cmd_results_new(CMD_INVALID, "id", "id cannot be 'id'");
+ return cmd_results_new(CMD_INVALID, "id cannot be 'id'");
}
// check if id is used by a previously defined bar
for (int i = 0; i < config->bars->length; ++i) {
struct bar_config *find = config->bars->items[i];
if (strcmp(name, find->id) == 0 && config->current_bar != find) {
- return cmd_results_new(CMD_FAILURE, "id",
+ return cmd_results_new(CMD_FAILURE,
"Id '%s' already defined for another bar. Id unchanged (%s).",
name, oldname);
}
@@ -31,5 +31,5 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
// free old bar id
free(config->current_bar->id);
config->current_bar->id = strdup(name);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c
index dcaf6da9..1698db8d 100644
--- a/sway/commands/bar/mode.c
+++ b/sway/commands/bar/mode.c
@@ -21,7 +21,7 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode
} else if (strcasecmp("invisible", mode) == 0) {
bar->mode = strdup("invisible");
} else {
- return cmd_results_new(CMD_INVALID, "mode", "Invalid value %s", mode);
+ return cmd_results_new(CMD_INVALID, "Invalid value %s", mode);
}
if (strcmp(old_mode, bar->mode) != 0) {
@@ -46,7 +46,7 @@ struct cmd_results *bar_cmd_mode(int argc, char **argv) {
}
if (config->reading && argc > 1) {
return cmd_results_new(CMD_INVALID,
- "mode", "Unexpected value %s in config mode", argv[1]);
+ "Unexpected value %s in config mode", argv[1]);
}
const char *mode = argv[0];
@@ -66,5 +66,5 @@ struct cmd_results *bar_cmd_mode(int argc, char **argv) {
}
}
}
- return error ? error : cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return error ? error : cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/modifier.c b/sway/commands/bar/modifier.c
index b5a16f45..0d28d6a2 100644
--- a/sway/commands/bar/modifier.c
+++ b/sway/commands/bar/modifier.c
@@ -11,7 +11,7 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "modifier", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
uint32_t mod = 0;
@@ -21,8 +21,8 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
if ((tmp_mod = get_modifier_mask_by_name(split->items[i])) > 0) {
mod |= tmp_mod;
} else {
- error = cmd_results_new(CMD_INVALID, "modifier",
- "Unknown modifier '%s'", split->items[i]);
+ error = cmd_results_new(CMD_INVALID,
+ "Unknown modifier '%s'", (char *)split->items[i]);
list_free_items_and_destroy(split);
return error;
}
@@ -31,5 +31,5 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
config->current_bar->modifier = mod;
wlr_log(WLR_DEBUG,
"Show/Hide the bar when pressing '%s' in hide mode.", argv[0]);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/output.c b/sway/commands/bar/output.c
index 930d779d..9ad10678 100644
--- a/sway/commands/bar/output.c
+++ b/sway/commands/bar/output.c
@@ -11,7 +11,7 @@ struct cmd_results *bar_cmd_output(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "output", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
const char *output = argv[0];
@@ -45,5 +45,5 @@ struct cmd_results *bar_cmd_output(int argc, char **argv) {
wlr_log(WLR_DEBUG, "Adding bar: '%s' to output '%s'",
config->current_bar->id, output);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/pango_markup.c b/sway/commands/bar/pango_markup.c
index d57cc45c..0ffa41d9 100644
--- a/sway/commands/bar/pango_markup.c
+++ b/sway/commands/bar/pango_markup.c
@@ -10,7 +10,7 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "pango_markup", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
config->current_bar->pango_markup
= parse_boolean(argv[0], config->current_bar->pango_markup);
@@ -21,5 +21,5 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s",
config->current_bar->id);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/position.c b/sway/commands/bar/position.c
index 2870f60f..2e3f79b4 100644
--- a/sway/commands/bar/position.c
+++ b/sway/commands/bar/position.c
@@ -10,7 +10,7 @@ struct cmd_results *bar_cmd_position(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "position", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
char *valid[] = { "top", "bottom" };
for (size_t i = 0; i < sizeof(valid) / sizeof(valid[0]); ++i) {
@@ -19,9 +19,8 @@ struct cmd_results *bar_cmd_position(int argc, char **argv) {
argv[0], config->current_bar->id);
free(config->current_bar->position);
config->current_bar->position = strdup(argv[0]);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
}
- return cmd_results_new(CMD_INVALID,
- "position", "Invalid value %s", argv[0]);
+ return cmd_results_new(CMD_INVALID, "Invalid value %s", argv[0]);
}
diff --git a/sway/commands/bar/separator_symbol.c b/sway/commands/bar/separator_symbol.c
index 060b8f52..145cdea5 100644
--- a/sway/commands/bar/separator_symbol.c
+++ b/sway/commands/bar/separator_symbol.c
@@ -9,12 +9,11 @@ struct cmd_results *bar_cmd_separator_symbol(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE,
- "separator_symbol", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
free(config->current_bar->separator_symbol);
config->current_bar->separator_symbol = strdup(argv[0]);
wlr_log(WLR_DEBUG, "Settings separator_symbol '%s' for bar: %s",
config->current_bar->separator_symbol, config->current_bar->id);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c
index 490393f1..c379cc72 100644
--- a/sway/commands/bar/status_command.c
+++ b/sway/commands/bar/status_command.c
@@ -9,8 +9,7 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE,
- "status_command", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
free(config->current_bar->status_command);
config->current_bar->status_command = NULL;
@@ -28,5 +27,5 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) {
load_swaybar(config->current_bar);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/status_edge_padding.c b/sway/commands/bar/status_edge_padding.c
index f3b10631..565ab9a9 100644
--- a/sway/commands/bar/status_edge_padding.c
+++ b/sway/commands/bar/status_edge_padding.c
@@ -11,11 +11,11 @@ struct cmd_results *bar_cmd_status_edge_padding(int argc, char **argv) {
char *end;
int padding = strtol(argv[0], &end, 10);
if (strlen(end) || padding < 0) {
- return cmd_results_new(CMD_INVALID, "status_edge_padding",
+ return cmd_results_new(CMD_INVALID,
"Padding must be a positive integer");
}
config->current_bar->status_edge_padding = padding;
wlr_log(WLR_DEBUG, "Status edge padding on bar %s: %d",
config->current_bar->id, config->current_bar->status_edge_padding);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/status_padding.c b/sway/commands/bar/status_padding.c
index 13b8eb6b..7a69a25d 100644
--- a/sway/commands/bar/status_padding.c
+++ b/sway/commands/bar/status_padding.c
@@ -11,11 +11,11 @@ struct cmd_results *bar_cmd_status_padding(int argc, char **argv) {
char *end;
int padding = strtol(argv[0], &end, 10);
if (strlen(end) || padding < 0) {
- return cmd_results_new(CMD_INVALID, "status_padding",
+ return cmd_results_new(CMD_INVALID,
"Padding must be a positive integer");
}
config->current_bar->status_padding = padding;
wlr_log(WLR_DEBUG, "Status padding on bar %s: %d",
config->current_bar->id, config->current_bar->status_padding);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/strip_workspace_name.c b/sway/commands/bar/strip_workspace_name.c
index 79692f6e..b74afd6e 100644
--- a/sway/commands/bar/strip_workspace_name.c
+++ b/sway/commands/bar/strip_workspace_name.c
@@ -11,8 +11,7 @@ struct cmd_results *bar_cmd_strip_workspace_name(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE,
- "strip_workspace_name", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
config->current_bar->strip_workspace_name =
@@ -28,5 +27,5 @@ struct cmd_results *bar_cmd_strip_workspace_name(int argc, char **argv) {
config->current_bar->id);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/strip_workspace_numbers.c b/sway/commands/bar/strip_workspace_numbers.c
index b33d01e5..9c6ec228 100644
--- a/sway/commands/bar/strip_workspace_numbers.c
+++ b/sway/commands/bar/strip_workspace_numbers.c
@@ -11,8 +11,7 @@ struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE,
- "strip_workspace_numbers", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
config->current_bar->strip_workspace_numbers =
@@ -28,5 +27,5 @@ struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv) {
config->current_bar->id);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/swaybar_command.c b/sway/commands/bar/swaybar_command.c
index 04e78e77..6253e2b1 100644
--- a/sway/commands/bar/swaybar_command.c
+++ b/sway/commands/bar/swaybar_command.c
@@ -9,12 +9,11 @@ struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE,
- "swaybar_command", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
free(config->current_bar->swaybar_command);
config->current_bar->swaybar_command = join_args(argv, argc);
wlr_log(WLR_DEBUG, "Using custom swaybar command: %s",
config->current_bar->swaybar_command);
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/tray_bindsym.c b/sway/commands/bar/tray_bindsym.c
index ad413446..4e57e35e 100644
--- a/sway/commands/bar/tray_bindsym.c
+++ b/sway/commands/bar/tray_bindsym.c
@@ -12,7 +12,7 @@ struct cmd_results *bar_cmd_tray_bindsym(int argc, char **argv) {
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "tray_bindsym", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
int button = 0;
@@ -21,7 +21,7 @@ struct cmd_results *bar_cmd_tray_bindsym(int argc, char **argv) {
button = argv[0][strlen("button")] - '0';
}
if (button < 1 || button > 9) {
- return cmd_results_new(CMD_FAILURE, "tray_bindsym",
+ return cmd_results_new(CMD_FAILURE,
"[Bar %s] Only buttons 1 to 9 are supported",
config->current_bar->id);
}
@@ -42,14 +42,14 @@ struct cmd_results *bar_cmd_tray_bindsym(int argc, char **argv) {
wlr_log(WLR_DEBUG, "[Bar %s] Binding button %d to %s",
config->current_bar->id, button, commands[i]);
config->current_bar->tray_bindings[button] = commands[i];
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
}
- return cmd_results_new(CMD_INVALID, "tray_bindsym",
+ return cmd_results_new(CMD_INVALID,
"[Bar %s] Invalid command %s", config->current_bar->id, argv[1]);
#else
- return cmd_results_new(CMD_INVALID, "tray_bindsym",
+ return cmd_results_new(CMD_INVALID,
"Sway has been compiled without tray support");
#endif
}
diff --git a/sway/commands/bar/tray_output.c b/sway/commands/bar/tray_output.c
index a1169c20..d45c09c6 100644
--- a/sway/commands/bar/tray_output.c
+++ b/sway/commands/bar/tray_output.c
@@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_tray_output(int argc, char **argv) {
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "tray_output", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
list_t *outputs = config->current_bar->tray_outputs;
@@ -34,9 +34,9 @@ struct cmd_results *bar_cmd_tray_output(int argc, char **argv) {
}
list_add(outputs, strdup(argv[0]));
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
#else
- return cmd_results_new(CMD_INVALID, "tray_output",
+ return cmd_results_new(CMD_INVALID,
"Sway has been compiled without tray support");
#endif
}
diff --git a/sway/commands/bar/tray_padding.c b/sway/commands/bar/tray_padding.c
index eb795b00..1e8b294b 100644
--- a/sway/commands/bar/tray_padding.c
+++ b/sway/commands/bar/tray_padding.c
@@ -16,27 +16,27 @@ struct cmd_results *bar_cmd_tray_padding(int argc, char **argv) {
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "tray_padding", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
struct bar_config *bar = config->current_bar;
char *end;
int padding = strtol(argv[0], &end, 10);
if (padding < 0 || (*end != '\0' && strcasecmp(end, "px") != 0)) {
- return cmd_results_new(CMD_INVALID, "tray_padding",
+ return cmd_results_new(CMD_INVALID,
"[Bar %s] Invalid tray padding value: %s", bar->id, argv[0]);
}
if (argc == 2 && strcasecmp(argv[1], "px") != 0) {
- return cmd_results_new(CMD_INVALID, "tray_padding",
+ return cmd_results_new(CMD_INVALID,
"Expected 'tray_padding <px> [px]'");
}
wlr_log(WLR_DEBUG, "[Bar %s] Setting tray padding to %d", bar->id, padding);
config->current_bar->tray_padding = padding;
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
#else
- return cmd_results_new(CMD_INVALID, "tray_padding",
+ return cmd_results_new(CMD_INVALID,
"Sway has been compiled without tray support");
#endif
}
diff --git a/sway/commands/bar/workspace_buttons.c b/sway/commands/bar/workspace_buttons.c
index cd001e20..773e6357 100644
--- a/sway/commands/bar/workspace_buttons.c
+++ b/sway/commands/bar/workspace_buttons.c
@@ -10,8 +10,7 @@ struct cmd_results *bar_cmd_workspace_buttons(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE,
- "workspace_buttons", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
config->current_bar->workspace_buttons =
parse_boolean(argv[0], config->current_bar->workspace_buttons);
@@ -22,5 +21,5 @@ struct cmd_results *bar_cmd_workspace_buttons(int argc, char **argv) {
wlr_log(WLR_DEBUG, "Disabling workspace buttons on bar: %s",
config->current_bar->id);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c
index 04a4e6b8..2f7bb090 100644
--- a/sway/commands/bar/wrap_scroll.c
+++ b/sway/commands/bar/wrap_scroll.c
@@ -10,7 +10,7 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
return error;
}
if (!config->current_bar) {
- return cmd_results_new(CMD_FAILURE, "wrap_scroll", "No bar defined.");
+ return cmd_results_new(CMD_FAILURE, "No bar defined.");
}
config->current_bar->wrap_scroll =
parse_boolean(argv[0], config->current_bar->wrap_scroll);
@@ -21,5 +21,5 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
wlr_log(WLR_DEBUG, "Disabling wrap scroll on bar: %s",
config->current_bar->id);
}
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ return cmd_results_new(CMD_SUCCESS, NULL);
}