diff options
Diffstat (limited to 'swaynag/config.c')
| -rw-r--r-- | swaynag/config.c | 23 | 
1 files changed, 22 insertions, 1 deletions
| diff --git a/swaynag/config.c b/swaynag/config.c index c6b4e431..6db7cce5 100644 --- a/swaynag/config.c +++ b/swaynag/config.c @@ -59,6 +59,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,  		{"config", required_argument, NULL, 'c'},  		{"debug", no_argument, NULL, 'd'},  		{"edge", required_argument, NULL, 'e'}, +		{"layer", required_argument, NULL, 'y'},  		{"font", required_argument, NULL, 'f'},  		{"help", no_argument, NULL, 'h'},  		{"detailed-message", no_argument, NULL, 'l'}, @@ -104,6 +105,8 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,  		"  -c, --config <path>             Path to config file.\n"  		"  -d, --debug                     Enable debugging.\n"  		"  -e, --edge top|bottom           Set the edge to use.\n" +		"  -y, --layer overlay|top|bottom|background\n" +	    "                                  Set the layer to use.\n"  		"  -f, --font <font>               Set the font to use.\n"  		"  -h, --help                      Show help message and quit.\n"  		"  -l, --detailed-message          Read a detailed message from stdin.\n" @@ -133,7 +136,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,  	optind = 1;  	while (1) { -		int c = getopt_long(argc, argv, "b:B:z:Z:c:de:f:hlL:m:o:s:t:v", opts, NULL); +		int c = getopt_long(argc, argv, "b:B:z:Z:c:de:y:f:hlL:m:o:s:t:v", opts, NULL);  		if (c == -1) {  			break;  		} @@ -184,6 +187,24 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,  				}  			}  			break; +		case 'y': // Layer +			if (type) { +				if (strcmp(optarg, "background") == 0) { +					type->layer = ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; +				} else if (strcmp(optarg, "bottom") == 0) { +					type->layer = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; +				} else if (strcmp(optarg, "top") == 0) { +					type->layer = ZWLR_LAYER_SHELL_V1_LAYER_TOP; +				} else if (strcmp(optarg, "overlay") == 0) { +					type->layer = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; +				} else { +					fprintf(stderr, "Invalid layer: %s\n" +							"Usage: --layer overlay|top|bottom|background\n", +							optarg); +					return EXIT_FAILURE; +				} +			} +			break;  		case 'f': // Font  			if (type) {  				free(type->font); | 
