From ead3f1e676923b0457cef77b0b482e76cac50307 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 29 Dec 2017 19:04:16 +0100 Subject: Allow to configure outputs by their identifier --- sway/config/output.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sway/config') 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 @@ #define _XOPEN_SOURCE 700 +#include #include #include #include @@ -14,6 +15,13 @@ int output_name_cmp(const void *item, const void *data) { return strcmp(output->name, name); } +void output_get_identifier(char *identifier, size_t len, + struct sway_output *output) { + struct wlr_output *wlr_output = output->wlr_output; + snprintf(identifier, len, "%s %s %s", wlr_output->make, wlr_output->model, + wlr_output->serial); +} + struct output_config *new_output_config(const char *name) { struct output_config *oc = calloc(1, sizeof(struct output_config)); if (oc == NULL) { -- cgit v1.2.3-54-g00ecf