diff --git a/sway/config/output.c b/sway/config/output.c index eadb4d21d..15ad7e50d 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -516,7 +516,7 @@ struct output_config *find_output_config(struct sway_output *sway_output) { char *name = sway_output->wlr_output->name; for (int i = 0; i < config->output_configs->length; ++i) { struct output_config *oc = config->output_configs->items[i]; - if (!strcmp(oc->name, "*") || !strcmp(oc->name, name) || !strcmp(oc->name, id)) { + if (!fnmatch(oc->name, name, 0) || !fnmatch(oc->name, id, 0)) { merge_output_config(result, oc); } } diff --git a/sway/sway-output.5.scd b/sway/sway-output.5.scd index 69f529fe3..28f90fe82 100644 --- a/sway/sway-output.5.scd +++ b/sway/sway-output.5.scd @@ -11,9 +11,9 @@ You may combine output commands into one, like so: output HDMI-A-1 mode 1920x1080 pos 1920 0 bg ~/wallpaper.png stretch You can get a list of output names with *swaymsg -t get_outputs*. You may also -match any output by using the output name "\*". Additionally, "-" can be used -to match the focused output by name and "--" can be used to match the focused -output by its identifier. +match using glob patterns including any output by using the output name "\*". +Additionally, "-" can be used to match the focused output by name and "--" can +be used to match the focused output by its identifier. Some outputs may have different names when disconnecting and reconnecting. To identify these, the name can be substituted for a string consisting of the make, @@ -22,6 +22,10 @@ must be separated by one space. For example: output "Some Company ABC123 0x00000000" pos 1920 0 +Glob patterns can be used to match any output of that make and model: + + output "Some Company ABC123\*" pos 1920 0 + # COMMANDS *output* mode|resolution|res [--custom] [@Hz]