From 3ccf897693f2af81235fcfaf41456b7d031cfb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= <150025636+git-f0x@users.noreply.github.com> Date: Fri, 4 Sep 2026 19:24:06 +0200 Subject: [PATCH] feat: set `COSMIC_VERSION` env var --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c37f2ce..a9181bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -300,7 +300,7 @@ dependencies = [ [[package]] name = "cosmic-session" -version = "1.0.0" +version = "1.8.0" dependencies = [ "color-eyre", "cosmic-dbus-a11y", diff --git a/Cargo.toml b/Cargo.toml index 136af09..47f8dea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cosmic-session" description = "The session manager for the COSMIC desktop environment" -version = "1.0.0" +version = "1.8.0" license = "GPL-3.0-only" edition = "2024" rust-version = "1.93" diff --git a/src/main.rs b/src/main.rs index 1db82d0..6c26691 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,6 +166,13 @@ async fn start( env_vars.push(("XDG_SESSION_TYPE".to_string(), "wayland".to_string())); systemd::set_systemd_environment("XDG_SESSION_TYPE", "wayland").await; + // expose the session version + env_vars.push(( + "COSMIC_VERSION".to_string(), + env!("CARGO_PKG_VERSION").to_string(), + )); + systemd::set_systemd_environment("COSMIC_VERSION", env!("CARGO_PKG_VERSION")).await; + #[cfg(feature = "systemd")] let _inhibit_fd = if *is_systemd_used() { match get_systemd_env().await {