diff options
author | 2019-01-13 20:33:44 -0500 | |
---|---|---|
committer | 2019-01-13 20:33:44 -0500 | |
commit | 9b5ac0868210dba6d296b10ce429ac6649ff2c0c (patch) | |
tree | e67ce8fa488a6df6d2bb2bca46a74ace35b2b5d5 /swaybar/tray | |
parent | Merge pull request #3412 from RedSoxFan/fix-cont-line-num (diff) | |
parent | swaybar: allow identifiers for output and tray (diff) | |
download | sway-9b5ac0868210dba6d296b10ce429ac6649ff2c0c.tar.gz sway-9b5ac0868210dba6d296b10ce429ac6649ff2c0c.tar.zst sway-9b5ac0868210dba6d296b10ce429ac6649ff2c0c.zip |
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) { | |||
101 | } | 101 | } |
102 | 102 | ||
103 | static int cmp_output(const void *item, const void *cmp_to) { | 103 | static int cmp_output(const void *item, const void *cmp_to) { |
104 | return strcmp(item, cmp_to); | 104 | const struct swaybar_output *output = cmp_to; |
105 | if (output->identifier && strcmp(item, output->identifier) == 0) { | ||
106 | return 0; | ||
107 | } | ||
108 | return strcmp(item, output->name); | ||
105 | } | 109 | } |
106 | 110 | ||
107 | uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x) { | 111 | uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x) { |
108 | struct swaybar_config *config = output->bar->config; | 112 | struct swaybar_config *config = output->bar->config; |
109 | if (config->tray_outputs) { | 113 | if (config->tray_outputs) { |
110 | if (list_seq_find(config->tray_outputs, cmp_output, output->name) == -1) { | 114 | if (list_seq_find(config->tray_outputs, cmp_output, output) == -1) { |
111 | return 0; | 115 | return 0; |
112 | } | 116 | } |
113 | } // else display on all | 117 | } // else display on all |