Allow to configure outputs by their identifier

This commit is contained in:
emersion 2017-12-29 19:04:16 +01:00
parent 150e145a51
commit ead3f1e676
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 75 additions and 51 deletions

View file

@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <wlr/types/wlr_output.h>
@ -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) {