1
0
Fork 0
forked from wry/wry

add config sourcing

This commit is contained in:
kossLAN 2026-04-04 20:47:43 -04:00
parent e80a328381
commit 4e6e891d9b
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View file

@ -226,6 +226,7 @@ fn start_compositor2(
let color_manager = ColorManager::new();
let crit_ids = Rc::new(CritMatcherIds::default());
let eventfd_cache = EventfdCache::new(&ring, &engine);
let explicit_config_dir = run_args.config_dir.clone();
let state = Rc::new(State {
pid,
kb_ctx,
@ -305,7 +306,7 @@ fn start_compositor2(
serial: Default::default(),
idle_inhibitor_ids: Default::default(),
run_toplevel,
config_dir: config_dir(),
config_dir: explicit_config_dir.or_else(config_dir),
config_file_id: NumCell::new(1),
tracker: Default::default(),
data_offer_ids: Default::default(),
@ -820,6 +821,9 @@ fn create_dummy_output(state: &Rc<State>) {
}
pub fn config_dir() -> Option<String> {
if let Ok(dir) = env::var("JAY_CONFIG_DIR") {
return Some(dir);
}
if let Ok(xdg) = env::var("XDG_CONFIG_HOME") {
Some(format!("{}/jay", xdg))
} else if let Ok(home) = env::var("HOME") {