mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 13:04:11 +01:00
Shim client.background and client.placeholder
These are not supported by sway, but are valid i3 commands and should not cause config errors. Also includes a couple of minor touch-ups.
This commit is contained in:
parent
7252c7f715
commit
92e1fc00fd
@ -103,6 +103,7 @@ sway_cmd cmd_bar;
|
|||||||
sway_cmd cmd_bindcode;
|
sway_cmd cmd_bindcode;
|
||||||
sway_cmd cmd_bindsym;
|
sway_cmd cmd_bindsym;
|
||||||
sway_cmd cmd_border;
|
sway_cmd cmd_border;
|
||||||
|
sway_cmd cmd_client_noop;
|
||||||
sway_cmd cmd_client_focused;
|
sway_cmd cmd_client_focused;
|
||||||
sway_cmd cmd_client_focused_inactive;
|
sway_cmd cmd_client_focused_inactive;
|
||||||
sway_cmd cmd_client_unfocused;
|
sway_cmd cmd_client_unfocused;
|
||||||
|
@ -77,8 +77,10 @@ static struct cmd_handler handlers[] = {
|
|||||||
{ "bar", cmd_bar },
|
{ "bar", cmd_bar },
|
||||||
{ "bindcode", cmd_bindcode },
|
{ "bindcode", cmd_bindcode },
|
||||||
{ "bindsym", cmd_bindsym },
|
{ "bindsym", cmd_bindsym },
|
||||||
|
{ "client.background", cmd_client_noop },
|
||||||
{ "client.focused", cmd_client_focused },
|
{ "client.focused", cmd_client_focused },
|
||||||
{ "client.focused_inactive", cmd_client_focused_inactive },
|
{ "client.focused_inactive", cmd_client_focused_inactive },
|
||||||
|
{ "client.placeholder", cmd_client_noop },
|
||||||
{ "client.unfocused", cmd_client_unfocused },
|
{ "client.unfocused", cmd_client_unfocused },
|
||||||
{ "client.urgent", cmd_client_urgent },
|
{ "client.urgent", cmd_client_urgent },
|
||||||
{ "default_border", cmd_default_border },
|
{ "default_border", cmd_default_border },
|
||||||
|
@ -64,27 +64,27 @@ static struct cmd_results *handle_command(int argc, char **argv,
|
|||||||
|
|
||||||
if (!parse_color_float(argv[0], class->border)) {
|
if (!parse_color_float(argv[0], class->border)) {
|
||||||
return cmd_results_new(CMD_INVALID, cmd_name,
|
return cmd_results_new(CMD_INVALID, cmd_name,
|
||||||
"Unable to parse border color");
|
"Unable to parse border color '%s'", argv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parse_color_float(argv[1], class->background)) {
|
if (!parse_color_float(argv[1], class->background)) {
|
||||||
return cmd_results_new(CMD_INVALID, cmd_name,
|
return cmd_results_new(CMD_INVALID, cmd_name,
|
||||||
"Unable to parse background color");
|
"Unable to parse background color '%s'", argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parse_color_float(argv[2], class->text)) {
|
if (!parse_color_float(argv[2], class->text)) {
|
||||||
return cmd_results_new(CMD_INVALID, cmd_name,
|
return cmd_results_new(CMD_INVALID, cmd_name,
|
||||||
"Unable to parse text color");
|
"Unable to parse text color '%s'", argv[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parse_color_float(argv[3], class->indicator)) {
|
if (!parse_color_float(argv[3], class->indicator)) {
|
||||||
return cmd_results_new(CMD_INVALID, cmd_name,
|
return cmd_results_new(CMD_INVALID, cmd_name,
|
||||||
"Unable to parse indicator color");
|
"Unable to parse indicator color '%s'", argv[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parse_color_float(argv[4], class->child_border)) {
|
if (!parse_color_float(argv[4], class->child_border)) {
|
||||||
return cmd_results_new(CMD_INVALID, cmd_name,
|
return cmd_results_new(CMD_INVALID, cmd_name,
|
||||||
"Unable to parse child border color");
|
"Unable to parse child border color '%s'", argv[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->active) {
|
if (config->active) {
|
||||||
@ -114,3 +114,8 @@ struct cmd_results *cmd_client_unfocused(int argc, char **argv) {
|
|||||||
struct cmd_results *cmd_client_urgent(int argc, char **argv) {
|
struct cmd_results *cmd_client_urgent(int argc, char **argv) {
|
||||||
return handle_command(argc, argv, &config->border_colors.urgent, "client.urgent");
|
return handle_command(argc, argv, &config->border_colors.urgent, "client.urgent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct cmd_results *cmd_client_noop(int argc, char **argv) {
|
||||||
|
wlr_log(WLR_INFO, "Warning: %s is ignored by sway", argv[-1]);
|
||||||
|
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user