diff options
author | emersion <contact@emersion.fr> | 2017-12-29 19:04:16 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-12-29 19:04:16 +0100 |
commit | ead3f1e676923b0457cef77b0b482e76cac50307 (patch) | |
tree | 6a4c75b23de360d4eadbf4e1aa647a0d93c81eb2 /sway/config/output.c | |
parent | Merge pull request #1542 from emersion/swaymsg-output (diff) | |
download | sway-ead3f1e676923b0457cef77b0b482e76cac50307.tar.gz sway-ead3f1e676923b0457cef77b0b482e76cac50307.tar.zst sway-ead3f1e676923b0457cef77b0b482e76cac50307.zip |
Allow to configure outputs by their identifier
Diffstat (limited to 'sway/config/output.c')
-rw-r--r-- | sway/config/output.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index f336c949..e798a20e 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #define _XOPEN_SOURCE 700 | 1 | #define _XOPEN_SOURCE 700 |
2 | #include <stdbool.h> | ||
2 | #include <string.h> | 3 | #include <string.h> |
3 | #include <assert.h> | 4 | #include <assert.h> |
4 | #include <wlr/types/wlr_output.h> | 5 | #include <wlr/types/wlr_output.h> |
@@ -14,6 +15,13 @@ int output_name_cmp(const void *item, const void *data) { | |||
14 | return strcmp(output->name, name); | 15 | return strcmp(output->name, name); |
15 | } | 16 | } |
16 | 17 | ||
18 | void output_get_identifier(char *identifier, size_t len, | ||
19 | struct sway_output *output) { | ||
20 | struct wlr_output *wlr_output = output->wlr_output; | ||
21 | snprintf(identifier, len, "%s %s %s", wlr_output->make, wlr_output->model, | ||
22 | wlr_output->serial); | ||
23 | } | ||
24 | |||
17 | struct output_config *new_output_config(const char *name) { | 25 | struct output_config *new_output_config(const char *name) { |
18 | struct output_config *oc = calloc(1, sizeof(struct output_config)); | 26 | struct output_config *oc = calloc(1, sizeof(struct output_config)); |
19 | if (oc == NULL) { | 27 | if (oc == NULL) { |