@@ -25,14 +25,21 @@ pub enum DesktopEnvironment {
2525 ///
2626 /// - <https://en.wikipedia.org/wiki/Cinnamon_(desktop_environment)>
2727 Cinnamon ,
28- /// COSMIC, the default desktop environment for Linux Pop!_OS.
28+ /// COSMIC, the legacy GNOME-based desktop environment for Linux Pop!_OS.
2929 ///
30- /// Note: This corresponds to the classic COSMIC based on GNOME, not the Rust
31- /// [COSMIC-epoch ](https://github.com/pop-os/cosmic-epoch). Please send a PR if you can
32- /// test how to detect cosmic-epoch .
30+ /// Note: This corresponds to the classic COSMIC based on GNOME. For the new
31+ /// [COSMIC Epoch ](https://github.com/pop-os/cosmic-epoch) desktop
32+ /// environment built in Rust, use [`DesktopEnvironment::CosmicEpoch`] .
3333 ///
3434 /// - <https://github.com/pop-os/cosmic>
3535 Cosmic ,
36+ /// COSMIC Epoch
37+ ///
38+ /// Note: This corresponds to the new COSMIC desktop environment
39+ /// built by System76 in Rust for Linux Pop!_OS.
40+ ///
41+ /// - <https://github.com/pop-os/cosmic-epoch>
42+ CosmicEpoch ,
3643 /// Deepin desktop environment
3744 ///
3845 /// - <https://www.deepin.org/index/en>
@@ -206,6 +213,7 @@ impl DesktopEnvironment {
206213 pub fn from_freedesktop ( name : & str ) -> Option < Self > {
207214 // the patterns in the match below are ordered to match the order in the freedesktop table
208215 match name {
216+ "COSMIC" => Some ( DesktopEnvironment :: CosmicEpoch ) ,
209217 "GNOME" => Some ( DesktopEnvironment :: Gnome ) ,
210218 "GNOME-Classic" => Some ( DesktopEnvironment :: Gnome ) ,
211219 "GNOME-Flashback" => Some ( DesktopEnvironment :: Gnome ) ,
@@ -368,6 +376,10 @@ mod tests {
368376 DesktopEnvironment :: from_xdg_current_desktop( "Hyprland" ) ,
369377 Some ( DesktopEnvironment :: Hyprland )
370378 ) ;
379+ assert_eq ! (
380+ DesktopEnvironment :: from_xdg_current_desktop( "COSMIC" ) ,
381+ Some ( DesktopEnvironment :: CosmicEpoch )
382+ ) ;
371383
372384 // Colon splitting
373385 assert_eq ! (
0 commit comments