mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	src/main.c: add environment variable LABWC_VER
src/config/session.c add env var LABWC_VER This could be useful going forward for helper programs such as `labwc-menu-generator` or `labwc-tweaks`
This commit is contained in:
		
							parent
							
								
									3b00aabd93
								
							
						
					
					
						commit
						4d3efb4339
					
				
					 2 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -29,6 +29,7 @@ static const char *const env_vars[] = {
 | 
				
			||||||
	"XCURSOR_THEME",
 | 
						"XCURSOR_THEME",
 | 
				
			||||||
	"XDG_SESSION_TYPE",
 | 
						"XDG_SESSION_TYPE",
 | 
				
			||||||
	"LABWC_PID",
 | 
						"LABWC_PID",
 | 
				
			||||||
 | 
						"LABWC_VER",
 | 
				
			||||||
	NULL
 | 
						NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -191,6 +191,13 @@ main(int argc, char *argv[])
 | 
				
			||||||
		wlr_log(WLR_DEBUG, "LABWC_PID=%s", pid);
 | 
							wlr_log(WLR_DEBUG, "LABWC_PID=%s", pid);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* useful for helper programs */
 | 
				
			||||||
 | 
						if (setenv("LABWC_VER", LABWC_VERSION, true) < 0) {
 | 
				
			||||||
 | 
							wlr_log_errno(WLR_ERROR, "unable to set LABWC_VER");
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							wlr_log(WLR_DEBUG, "LABWC_VER=%s", LABWC_VERSION);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!getenv("XDG_RUNTIME_DIR")) {
 | 
						if (!getenv("XDG_RUNTIME_DIR")) {
 | 
				
			||||||
		wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is unset");
 | 
							wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is unset");
 | 
				
			||||||
		exit(EXIT_FAILURE);
 | 
							exit(EXIT_FAILURE);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue