use bevy_ecs::prelude::*; use std::collections::BTreeMap; use std::ffi::OsString; use crate::apogee_core_v1::apogee_environment_v1; #[derive(Resource)] pub struct Environment(pub BTreeMap); impl Default for Environment { fn default() -> Self { Self(std::env::vars_os().collect()) } } impl hyprwire::Dispatch for crate::Apogee { fn event( &mut self, _object: &apogee_environment_v1::ApogeeEnvironmentV1, event: ::Event<'_>, ) { match event { apogee_environment_v1::Event::Setenv { name, value } => { self.world .resource_mut::() .0 .insert(name.into(), value.into()); } } } }