Skip to content

Commit

Permalink
feat: set RYANABX_SHELL_DESKTOP to set the desktop session, defaults …
Browse files Browse the repository at this point in the history
…to XDG_CURRENT_DESKTOP
  • Loading branch information
ryanabx committed Aug 13, 2024
1 parent 57a33d2 commit 6a6fc56
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/compositor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ pub enum WaylandMessage {
}

pub(crate) fn wayland_subscription() -> iced::Subscription<WaylandMessage> {
match env::var("XDG_CURRENT_DESKTOP").as_deref() {
// set the environment variable RYANABX_SHELL_DESKTOP to set which desktop session should be inferred
let current_compositor = match env::var("RYANABX_SHELL_DESKTOP") {
Ok(val) => Ok(val),
_ => env::var("XDG_CURRENT_DESKTOP"), // fall back on XDG_CURRENT_DESKTOP if not set
};
match current_compositor.as_deref() {
Ok("COSMIC") => cosmic_comp::wayland_subscription().map(WaylandMessage::CosmicComp),
_ => panic!("Unsupported desktop"),
}
Expand Down

0 comments on commit 6a6fc56

Please sign in to comment.