mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Add src/config/config-dir.c
This commit is contained in:
		
							parent
							
								
									7fc643fdb9
								
							
						
					
					
						commit
						ccc818fda5
					
				
					 5 changed files with 102 additions and 6 deletions
				
			
		
							
								
								
									
										10
									
								
								src/main.c
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/main.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -8,7 +8,7 @@ struct rcxml rc = { 0 };
 | 
			
		|||
struct theme theme = { 0 };
 | 
			
		||||
 | 
			
		||||
static const char labwc_usage[] =
 | 
			
		||||
"Usage: labwc [-h] [-s <command>]\n";
 | 
			
		||||
"Usage: labwc [-h] [-s <startup-command>] [-c <config-file>]\n";
 | 
			
		||||
 | 
			
		||||
static void usage(void)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -19,14 +19,18 @@ static void usage(void)
 | 
			
		|||
int main(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
	char *startup_cmd = NULL;
 | 
			
		||||
	char *config_file = NULL;
 | 
			
		||||
	wlr_log_init(WLR_ERROR, NULL);
 | 
			
		||||
 | 
			
		||||
	int c;
 | 
			
		||||
	while ((c = getopt(argc, argv, "s:h")) != -1) {
 | 
			
		||||
	while ((c = getopt(argc, argv, "s:c:h")) != -1) {
 | 
			
		||||
		switch (c) {
 | 
			
		||||
		case 's':
 | 
			
		||||
			startup_cmd = optarg;
 | 
			
		||||
			break;
 | 
			
		||||
		case 'c':
 | 
			
		||||
			config_file = optarg;
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			usage();
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +38,7 @@ int main(int argc, char *argv[])
 | 
			
		|||
	if (optind < argc)
 | 
			
		||||
		usage();
 | 
			
		||||
 | 
			
		||||
	rcxml_read("data/rc.xml");
 | 
			
		||||
	rcxml_read(config_file);
 | 
			
		||||
 | 
			
		||||
	/* Wayland requires XDG_RUNTIME_DIR to be set */
 | 
			
		||||
	if (!getenv("XDG_RUNTIME_DIR")) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue