Skip to content

Commit

Permalink
Add a --list-layers option
Browse files Browse the repository at this point in the history
To get a list of available layers for the -l option.

Signed-off-by: Emmanuel LE TRONG <emmanuel.le-trong@cnrs-orleans.fr>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
  • Loading branch information
le-migou authored and proycon committed Aug 16, 2022
1 parent 7af52d6 commit acf38cf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,17 @@ usage(char *argv0) {
fprintf(stderr, " --swipe-sp [rrggbb|aa] - Set color of swiped special keys\n");
fprintf(stderr, " --text [rrggbb|aa] - Set color of text on keys\n");
fprintf(stderr, " --text-sp [rrggbb|aa] - Set color of text on special keys\n");
fprintf(stderr, " --list-layers - Print the list of available layers\n");
}

void
list_layers() {
int i;
for (i = 0; i < NumLayouts - 1; i++) {
if (layouts[i].name) {
puts(layouts[i].name);
}
}
}

void
Expand Down Expand Up @@ -567,6 +578,10 @@ main(int argc, char **argv) {
} else if ((!strcmp(argv[i], "-hidden")) ||
(!strcmp(argv[i], "--hidden"))) {
hidden = true;
} else if ((!strcmp(argv[i], "-list-layers")) ||
(!strcmp(argv[i], "--list-layers"))) {
list_layers();
exit(0);
} else {
fprintf(stderr, "Invalid argument: %s\n", argv[i]);
usage(argv[0]);
Expand Down

0 comments on commit acf38cf

Please sign in to comment.