diff options
Diffstat (limited to 'sway/old/commands/client.c')
-rw-r--r-- | sway/old/commands/client.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/sway/old/commands/client.c b/sway/old/commands/client.c deleted file mode 100644 index f3d879cd..00000000 --- a/sway/old/commands/client.c +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | #include <stdlib.h> | ||
2 | #include <string.h> | ||
3 | #include "sway/commands.h" | ||
4 | |||
5 | static struct cmd_results *parse_border_color(struct border_colors *border_colors, const char *cmd_name, int argc, char **argv) { | ||
6 | struct cmd_results *error = NULL; | ||
7 | if (argc < 3 || argc > 5) { | ||
8 | return cmd_results_new(CMD_INVALID, cmd_name, "Requires between three and five color values"); | ||
9 | } | ||
10 | |||
11 | uint32_t *colors[5] = { | ||
12 | &border_colors->border, | ||
13 | &border_colors->background, | ||
14 | &border_colors->text, | ||
15 | &border_colors->indicator, | ||
16 | &border_colors->child_border | ||
17 | }; | ||
18 | int i; | ||
19 | for (i = 0; i < argc; i++) { | ||
20 | char buffer[10]; | ||
21 | error = add_color(cmd_name, buffer, argv[i]); | ||
22 | if (error) { | ||
23 | return error; | ||
24 | } | ||
25 | *colors[i] = strtoul(buffer + 1, NULL, 16); | ||
26 | } | ||
27 | |||
28 | if (argc < 5) { | ||
29 | border_colors->child_border = border_colors->background; | ||
30 | } | ||
31 | |||
32 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
33 | } | ||
34 | |||
35 | struct cmd_results *cmd_client_focused(int argc, char **argv) { | ||
36 | return parse_border_color(&config->border_colors.focused, "client.focused", argc, argv); | ||
37 | } | ||
38 | |||
39 | struct cmd_results *cmd_client_focused_inactive(int argc, char **argv) { | ||
40 | return parse_border_color(&config->border_colors.focused_inactive, "client.focused_inactive", argc, argv); | ||
41 | } | ||
42 | |||
43 | struct cmd_results *cmd_client_unfocused(int argc, char **argv) { | ||
44 | return parse_border_color(&config->border_colors.unfocused, "client.unfocused", argc, argv); | ||
45 | } | ||
46 | |||
47 | struct cmd_results *cmd_client_urgent(int argc, char **argv) { | ||
48 | return parse_border_color(&config->border_colors.urgent, "client.urgent", argc, argv); | ||
49 | } | ||
50 | |||
51 | struct cmd_results *cmd_client_placeholder(int argc, char **argv) { | ||
52 | return parse_border_color(&config->border_colors.placeholder, "client.placeholder", argc, argv); | ||
53 | } | ||
54 | |||
55 | struct cmd_results *cmd_client_background(int argc, char **argv) { | ||
56 | char buffer[10]; | ||
57 | struct cmd_results *error = NULL; | ||
58 | uint32_t background; | ||
59 | |||
60 | if (argc != 1) { | ||
61 | return cmd_results_new(CMD_INVALID, "client.background", "Requires exactly one color value"); | ||
62 | } | ||
63 | |||
64 | error = add_color("client.background", buffer, argv[0]); | ||
65 | if (error) { | ||
66 | return error; | ||
67 | } | ||
68 | |||
69 | background = strtoul(buffer+1, NULL, 16); | ||
70 | config->border_colors.background = background; | ||
71 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
72 | } | ||