This commit is contained in:
emersion 2018-07-09 22:54:30 +01:00
parent ebcdce457a
commit 63b4bf5000
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
85 changed files with 391 additions and 385 deletions

View file

@ -45,7 +45,7 @@ struct cmd_results *cmd_assign(int argc, char **argv) {
criteria->target = join_args(argv, target_len);
list_add(config->criteria, criteria);
wlr_log(L_DEBUG, "assign: '%s' -> '%s' added", criteria->raw,
wlr_log(WLR_DEBUG, "assign: '%s' -> '%s' added", criteria->raw,
criteria->target);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -63,13 +63,13 @@ struct cmd_results *cmd_bar(int argc, char **argv) {
for (int i = 0; i < config->bars->length; ++i) {
struct bar_config *item = config->bars->items[i];
if (strcmp(item->id, argv[0]) == 0) {
wlr_log(L_DEBUG, "Selecting bar: %s", argv[0]);
wlr_log(WLR_DEBUG, "Selecting bar: %s", argv[0]);
bar = item;
break;
}
}
if (!bar) {
wlr_log(L_DEBUG, "Creating bar: %s", argv[0]);
wlr_log(WLR_DEBUG, "Creating bar: %s", argv[0]);
bar = default_bar_config();
if (!bar) {
return cmd_results_new(CMD_FAILURE, "bar",
@ -108,7 +108,7 @@ struct cmd_results *cmd_bar(int argc, char **argv) {
// Set current bar
config->current_bar = bar;
wlr_log(L_DEBUG, "Creating bar %s", bar->id);
wlr_log(WLR_DEBUG, "Creating bar %s", bar->id);
}
return config_subcommand(argv, argc, bar_handlers, sizeof(bar_handlers));

View file

@ -15,11 +15,11 @@ struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) {
}
if (strcasecmp("yes", argv[0]) == 0) {
config->current_bar->binding_mode_indicator = true;
wlr_log(L_DEBUG, "Enabling binding mode indicator on bar: %s",
wlr_log(WLR_DEBUG, "Enabling binding mode indicator on bar: %s",
config->current_bar->id);
} else if (strcasecmp("no", argv[0]) == 0) {
config->current_bar->binding_mode_indicator = false;
wlr_log(L_DEBUG, "Disabling binding mode indicator on bar: %s",
wlr_log(WLR_DEBUG, "Disabling binding mode indicator on bar: %s",
config->current_bar->id);
}
return cmd_results_new(CMD_INVALID, "binding_mode_indicator",

View file

@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_font(int argc, char **argv) {
char *font = join_args(argv, argc);
free(config->current_bar->font);
config->current_bar->font = font;
wlr_log(L_DEBUG, "Settings font '%s' for bar: %s",
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);
}

View file

@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_height(int argc, char **argv) {
"Invalid height value: %s", argv[0]);
}
config->current_bar->height = height;
wlr_log(L_DEBUG, "Setting bar height to %d on bar: %s",
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);
}

View file

@ -27,7 +27,7 @@ static struct cmd_results *bar_set_hidden_state(struct bar_config *bar,
if (!config->reading) {
ipc_event_barconfig_update(bar);
}
wlr_log(L_DEBUG, "Setting hidden_state: '%s' for bar: %s",
wlr_log(WLR_DEBUG, "Setting hidden_state: '%s' for bar: %s",
bar->hidden_state, bar->id);
}
// free old mode

View file

@ -24,7 +24,7 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
}
}
wlr_log(L_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name);
wlr_log(WLR_DEBUG, "Renaming bar: '%s' to '%s'", oldname, name);
// free old bar id
free(config->current_bar->id);

View file

@ -28,7 +28,7 @@ static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode
if (!config->reading) {
ipc_event_barconfig_update(bar);
}
wlr_log(L_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id);
wlr_log(WLR_DEBUG, "Setting mode: '%s' for bar: %s", bar->mode, bar->id);
}
// free old mode

View file

@ -30,7 +30,7 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
}
free_flat_list(split);
config->current_bar->modifier = mod;
wlr_log(L_DEBUG,
wlr_log(WLR_DEBUG,
"Show/Hide the bar when pressing '%s' in hide mode.", argv[0]);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -42,7 +42,7 @@ struct cmd_results *bar_cmd_output(int argc, char **argv) {
if (add_output) {
list_add(outputs, strdup(output));
wlr_log(L_DEBUG, "Adding bar: '%s' to output '%s'",
wlr_log(WLR_DEBUG, "Adding bar: '%s' to output '%s'",
config->current_bar->id, output);
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -13,11 +13,11 @@ struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) {
}
if (strcasecmp("enabled", argv[0]) == 0) {
config->current_bar->pango_markup = true;
wlr_log(L_DEBUG, "Enabling pango markup for bar: %s",
wlr_log(WLR_DEBUG, "Enabling pango markup for bar: %s",
config->current_bar->id);
} else if (strcasecmp("disabled", argv[0]) == 0) {
config->current_bar->pango_markup = false;
wlr_log(L_DEBUG, "Disabling pango markup for bar: %s",
wlr_log(WLR_DEBUG, "Disabling pango markup for bar: %s",
config->current_bar->id);
} else {
error = cmd_results_new(CMD_INVALID, "pango_markup",

View file

@ -15,7 +15,7 @@ struct cmd_results *bar_cmd_position(int argc, char **argv) {
char *valid[] = { "top", "bottom", "left", "right" };
for (size_t i = 0; i < sizeof(valid) / sizeof(valid[0]); ++i) {
if (strcasecmp(valid[i], argv[0]) == 0) {
wlr_log(L_DEBUG, "Setting bar position '%s' for bar: %s",
wlr_log(WLR_DEBUG, "Setting bar position '%s' for bar: %s",
argv[0], config->current_bar->id);
config->current_bar->position = strdup(argv[0]);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_separator_symbol(int argc, char **argv) {
}
free(config->current_bar->separator_symbol);
config->current_bar->separator_symbol = strdup(argv[0]);
wlr_log(L_DEBUG, "Settings separator_symbol '%s' for bar: %s",
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);
}

View file

@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_status_command(int argc, char **argv) {
}
free(config->current_bar->status_command);
config->current_bar->status_command = join_args(argv, argc);
wlr_log(L_DEBUG, "Feeding bar with status command: %s",
wlr_log(WLR_DEBUG, "Feeding bar with status command: %s",
config->current_bar->status_command);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -15,11 +15,11 @@ struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv) {
}
if (strcasecmp("yes", argv[0]) == 0) {
config->current_bar->strip_workspace_numbers = true;
wlr_log(L_DEBUG, "Stripping workspace numbers on bar: %s",
wlr_log(WLR_DEBUG, "Stripping workspace numbers on bar: %s",
config->current_bar->id);
} else if (strcasecmp("no", argv[0]) == 0) {
config->current_bar->strip_workspace_numbers = false;
wlr_log(L_DEBUG, "Enabling workspace numbers on bar: %s",
wlr_log(WLR_DEBUG, "Enabling workspace numbers on bar: %s",
config->current_bar->id);
} else {
return cmd_results_new(CMD_INVALID,

View file

@ -14,7 +14,7 @@ struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) {
}
free(config->current_bar->swaybar_command);
config->current_bar->swaybar_command = join_args(argv, argc);
wlr_log(L_DEBUG, "Using custom swaybar command: %s",
wlr_log(WLR_DEBUG, "Using custom swaybar command: %s",
config->current_bar->swaybar_command);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -14,11 +14,11 @@ struct cmd_results *bar_cmd_workspace_buttons(int argc, char **argv) {
}
if (strcasecmp("yes", argv[0]) == 0) {
config->current_bar->workspace_buttons = true;
wlr_log(L_DEBUG, "Enabling workspace buttons on bar: %s",
wlr_log(WLR_DEBUG, "Enabling workspace buttons on bar: %s",
config->current_bar->id);
} else if (strcasecmp("no", argv[0]) == 0) {
config->current_bar->workspace_buttons = false;
wlr_log(L_DEBUG, "Disabling workspace buttons on bar: %s",
wlr_log(WLR_DEBUG, "Disabling workspace buttons on bar: %s",
config->current_bar->id);
} else {
return cmd_results_new(CMD_INVALID, "workspace_buttons",

View file

@ -13,11 +13,11 @@ struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) {
}
if (strcasecmp("yes", argv[0]) == 0) {
config->current_bar->wrap_scroll = true;
wlr_log(L_DEBUG, "Enabling wrap scroll on bar: %s",
wlr_log(WLR_DEBUG, "Enabling wrap scroll on bar: %s",
config->current_bar->id);
} else if (strcasecmp("no", argv[0]) == 0) {
config->current_bar->wrap_scroll = false;
wlr_log(L_DEBUG, "Disabling wrap scroll on bar: %s",
wlr_log(WLR_DEBUG, "Disabling wrap scroll on bar: %s",
config->current_bar->id);
} else {
return cmd_results_new(CMD_INVALID,

View file

@ -184,7 +184,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
for (int i = 0; i < mode_bindings->length; ++i) {
struct sway_binding *config_binding = mode_bindings->items[i];
if (binding_key_compare(binding, config_binding)) {
wlr_log(L_DEBUG, "overwriting old binding with command '%s'",
wlr_log(WLR_DEBUG, "overwriting old binding with command '%s'",
config_binding->command);
free_sway_binding(config_binding);
mode_bindings->items[i] = binding;
@ -196,7 +196,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
list_add(mode_bindings, binding);
}
wlr_log(L_DEBUG, "%s - Bound %s to command %s",
wlr_log(WLR_DEBUG, "%s - Bound %s to command %s",
bindtype, argv[0], binding->command);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -8,7 +8,7 @@ struct cmd_results *cmd_exec(int argc, char **argv) {
if (!config->active) return cmd_results_new(CMD_DEFER, "exec", NULL);
if (config->reloading) {
char *args = join_args(argv, argc);
wlr_log(L_DEBUG, "Ignoring 'exec %s' due to reload", args);
wlr_log(WLR_DEBUG, "Ignoring 'exec %s' due to reload", args);
free(args);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -20,7 +20,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
char *tmp = NULL;
if (strcmp((char*)*argv, "--no-startup-id") == 0) {
wlr_log(L_INFO, "exec switch '--no-startup-id' not supported, ignored.");
wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored.");
if ((error = checkarg(argc - 1, "exec_always", EXPECTED_MORE_THAN, 0))) {
return error;
}
@ -35,11 +35,11 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
strncpy(cmd, tmp, sizeof(cmd) - 1);
cmd[sizeof(cmd) - 1] = 0;
free(tmp);
wlr_log(L_DEBUG, "Executing %s", cmd);
wlr_log(WLR_DEBUG, "Executing %s", cmd);
int fd[2];
if (pipe(fd) != 0) {
wlr_log(L_ERROR, "Unable to create pipe for fork");
wlr_log(WLR_ERROR, "Unable to create pipe for fork");
}
pid_t pid, child;
@ -73,7 +73,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
// cleanup child process
waitpid(pid, NULL, 0);
if (child > 0) {
wlr_log(L_DEBUG, "Child process created with pid %d", child);
wlr_log(WLR_DEBUG, "Child process created with pid %d", child);
// TODO: add PID to active workspace
} else {
return cmd_results_new(CMD_FAILURE, "exec_always",

View file

@ -24,7 +24,7 @@ struct cmd_results *cmd_for_window(int argc, char **argv) {
criteria->cmdlist = join_args(argv + 1, argc - 1);
list_add(config->criteria, criteria);
wlr_log(L_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist);
wlr_log(WLR_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -35,7 +35,7 @@ struct cmd_results *cmd_input(int argc, char **argv) {
return error;
}
wlr_log(L_DEBUG, "entering input block: %s", argv[0]);
wlr_log(WLR_DEBUG, "entering input block: %s", argv[0]);
config->handler_context.input_config = new_input_config(argv[0]);
if (!config->handler_context.input_config) {

View file

@ -16,7 +16,7 @@ struct cmd_results *input_cmd_events(int argc, char **argv) {
return cmd_results_new(CMD_FAILURE, "events",
"No input device defined.");
}
wlr_log(L_DEBUG, "events for device: %s",
wlr_log(WLR_DEBUG, "events for device: %s",
current_input_config->identifier);
struct input_config *new_config =
new_input_config(current_input_config->identifier);

View file

@ -28,7 +28,7 @@ struct cmd_results *input_cmd_tap(int argc, char **argv) {
"Expected 'tap <enabled|disabled>'");
}
wlr_log(L_DEBUG, "apply-tap for device: %s",
wlr_log(WLR_DEBUG, "apply-tap for device: %s",
current_input_config->identifier);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
new_config->xkb_layout = strdup(argv[0]);
wlr_log(L_DEBUG, "apply-xkb_layout for device: %s layout: %s",
wlr_log(WLR_DEBUG, "apply-xkb_layout for device: %s layout: %s",
current_input_config->identifier, new_config->xkb_layout);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
new_config->xkb_model = strdup(argv[0]);
wlr_log(L_DEBUG, "apply-xkb_model for device: %s model: %s",
wlr_log(WLR_DEBUG, "apply-xkb_model for device: %s model: %s",
current_input_config->identifier, new_config->xkb_model);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
new_config->xkb_options = strdup(argv[0]);
wlr_log(L_DEBUG, "apply-xkb_options for device: %s options: %s",
wlr_log(WLR_DEBUG, "apply-xkb_options for device: %s options: %s",
current_input_config->identifier, new_config->xkb_options);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
new_config->xkb_rules = strdup(argv[0]);
wlr_log(L_DEBUG, "apply-xkb_rules for device: %s rules: %s",
wlr_log(WLR_DEBUG, "apply-xkb_rules for device: %s rules: %s",
current_input_config->identifier, new_config->xkb_rules);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -19,7 +19,7 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
new_config->xkb_variant = strdup(argv[0]);
wlr_log(L_DEBUG, "apply-xkb_variant for device: %s variant: %s",
wlr_log(WLR_DEBUG, "apply-xkb_variant for device: %s variant: %s",
current_input_config->identifier, new_config->xkb_variant);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -65,7 +65,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
return error;
}
if ((config->reading && argc > 1) || (!config->reading && argc == 1)) {
wlr_log(L_DEBUG, "Switching to mode `%s' (pango=%d)",
wlr_log(WLR_DEBUG, "Switching to mode `%s' (pango=%d)",
mode->name, mode->pango);
}
// Set current mode

View file

@ -29,7 +29,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
struct output_config *output = new_output_config(argv[0]);
if (!output) {
wlr_log(L_ERROR, "Failed to allocate output config");
wlr_log(WLR_ERROR, "Failed to allocate output config");
return NULL;
}
argc--; argv++;
@ -71,7 +71,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
list_add(config->output_configs, output);
}
wlr_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz "
wlr_log(WLR_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz "
"position %d,%d scale %f transform %d) (bg %s %s) (dpms %d)",
output->name, output->enabled, output->width, output->height,
output->refresh_rate, output->x, output->y, output->scale,
@ -85,7 +85,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
struct sway_output *sway_output;
wl_list_for_each(sway_output, &root_container.sway_root->outputs, link) {
output_get_identifier(identifier, sizeof(identifier), sway_output);
wlr_log(L_DEBUG, "Checking identifier %s", identifier);
wlr_log(WLR_DEBUG, "Checking identifier %s", identifier);
if (all || strcmp(sway_output->wlr_output->name, output->name) == 0
|| strcmp(identifier, output->name) == 0) {
if (!sway_output->swayc) {

View file

@ -72,7 +72,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
src = strdup(p.we_wordv[0]);
wordfree(&p);
if (!src) {
wlr_log(L_ERROR, "Failed to duplicate string");
wlr_log(WLR_ERROR, "Failed to duplicate string");
return cmd_results_new(CMD_FAILURE, "output",
"Unable to allocate resource");
}
@ -82,7 +82,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
char *conf = strdup(config->current_config);
if (!conf) {
wlr_log(L_ERROR, "Failed to duplicate string");
wlr_log(WLR_ERROR, "Failed to duplicate string");
free(src);
return cmd_results_new(CMD_FAILURE, "output",
"Unable to allocate resources");
@ -94,7 +94,7 @@ struct cmd_results *output_cmd_background(int argc, char **argv) {
if (!src) {
free(rel_path);
free(conf);
wlr_log(L_ERROR, "Unable to allocate memory");
wlr_log(WLR_ERROR, "Unable to allocate memory");
return cmd_results_new(CMD_FAILURE, "output",
"Unable to allocate resources");
}

View file

@ -68,7 +68,7 @@ struct cmd_results *cmd_rename(int argc, char **argv) {
"Workspace already exists");
}
wlr_log(L_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);
wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);
free(workspace->name);
workspace->name = new_name;

View file

@ -95,7 +95,7 @@ static void resize_tiled(int amount, enum resize_axis axis) {
return;
}
wlr_log(L_DEBUG,
wlr_log(WLR_DEBUG,
"Found the proper parent: %p. It has %d l conts, and %d r conts",
parent->parent, minor_weight, major_weight);

View file

@ -32,7 +32,7 @@ struct cmd_results *cmd_set(int argc, char **argv) {
}
if (argv[0][0] != '$') {
wlr_log(L_INFO, "Warning: variable '%s' doesn't start with $", argv[0]);
wlr_log(WLR_INFO, "Warning: variable '%s' doesn't start with $", argv[0]);
size_t size = snprintf(NULL, 0, "$%s", argv[0]);
tmp = malloc(size + 1);

View file

@ -13,7 +13,7 @@ struct cmd_results *cmd_swaybg_command(int argc, char **argv) {
free(config->swaybg_command);
}
config->swaybg_command = join_args(argv, argc);
wlr_log(L_DEBUG, "Using custom swaybg command: %s",
wlr_log(WLR_DEBUG, "Using custom swaybg command: %s",
config->swaybg_command);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -51,7 +51,7 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
free(old); // workspaces can only be assigned to a single output
list_del(config->workspace_outputs, i);
}
wlr_log(L_DEBUG, "Assigning workspace %s to output %s", wso->workspace, wso->output);
wlr_log(WLR_DEBUG, "Assigning workspace %s to output %s", wso->workspace, wso->output);
list_add(config->workspace_outputs, wso);
} else {
if (config->reading || !config->active) {