diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-01-13 20:33:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-13 20:33:44 -0500 |
commit | 9b5ac0868210dba6d296b10ce429ac6649ff2c0c (patch) | |
tree | e67ce8fa488a6df6d2bb2bca46a74ace35b2b5d5 /swaybar/tray | |
parent | a43863aa60bd9eff0972d096610cb5a6de79aacb (diff) | |
parent | 50d36ef238182c33bca8dfc01dd56957e31ff6bd (diff) |
Merge pull request #3415 from RedSoxFan/swaybar-output-improved
swaybar: allow identifiers for output and tray
Diffstat (limited to 'swaybar/tray')
-rw-r--r-- | swaybar/tray/tray.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/swaybar/tray/tray.c b/swaybar/tray/tray.c index 0c3517cb..d5d0c84e 100644 --- a/swaybar/tray/tray.c +++ b/swaybar/tray/tray.c @@ -101,13 +101,17 @@ void tray_in(int fd, short mask, void *data) { } static int cmp_output(const void *item, const void *cmp_to) { - return strcmp(item, cmp_to); + const struct swaybar_output *output = cmp_to; + if (output->identifier && strcmp(item, output->identifier) == 0) { + return 0; + } + return strcmp(item, output->name); } uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x) { struct swaybar_config *config = output->bar->config; if (config->tray_outputs) { - if (list_seq_find(config->tray_outputs, cmp_output, output->name) == -1) { + if (list_seq_find(config->tray_outputs, cmp_output, output) == -1) { return 0; } } // else display on all |