output: add "named" to multi-output-modes

This commit is contained in:
qaqland 2025-05-11 10:42:29 +08:00
parent 6efb3b5042
commit b4e9f729c3
3 changed files with 28 additions and 8 deletions

3
cage.c
View file

@ -231,6 +231,7 @@ usage(FILE *file, const char *cage)
" -h\t Display this help message\n"
" -m extend Extend the display across all connected outputs (default)\n"
" -m last Use only the last connected output\n"
" -m named Use the output specified by the environment CAGE_OUTPUT_NAME, or fallback to last\n"
" -s\t Allow VT switching\n"
" -v\t Show the version number and exit\n"
"\n"
@ -258,6 +259,8 @@ parse_args(struct cg_server *server, int argc, char *argv[])
server->output_mode = CAGE_MULTI_OUTPUT_MODE_LAST;
} else if (strcmp(optarg, "extend") == 0) {
server->output_mode = CAGE_MULTI_OUTPUT_MODE_EXTEND;
} else if (strcmp(optarg, "named") == 0) {
server->output_mode = CAGE_MULTI_OUTPUT_MODE_NAMED;
}
break;
case 's':