#[non_exhaustive]
pub enum DesktopEnvironment {
Cinnamon,
Cosmic,
Enlightenment,
Gnome,
Kde,
Lxde,
Lxqt,
MacOs,
Mate,
Unity,
Windows,
Xfce,
}
Expand description
Desktop environments supported by detect-desktop-environment
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cinnamon
Cinnamon, the default desktop environment for Linux Mint.
Cosmic
COSMIC, the default desktop environment for Linux Pop!_OS.
Note: This corresponds to the classic COSMIC based on GNOME, not the Rust COSMIC-epoch. Please send a PR if you can test how to detect cosmic-epoch.
Enlightenment
Enlightenment desktop environment.
Gnome
Gnome, the default environment for many major Linux distributions.
Kde
KDE Plasma, the Kool Desktop Environment.
Lxde
Lxqt
MacOs
MacOs, the environment for Apple’s OS
Mate
Unity
Unity, the legace desktop environment for Ubuntu
Windows
Windows, the environments for Microsoft’s OS
Xfce
Xfce
Implementations§
source§impl DesktopEnvironment
impl DesktopEnvironment
sourcepub fn detect() -> Option<Self>
pub fn detect() -> Option<Self>
Detect the current desktop environment
If the current desktop environment can’t be detected, None
is returned.
sourcepub const fn gtk(self) -> bool
pub const fn gtk(self) -> bool
Test if the desktop environment is based on the GTK framework
See https://en.wikipedia.org/wiki/Category:Desktop_environments_based_on_GTK
use detect_desktop_environment::DesktopEnvironment;
// All matching desktop environments:
assert!(DesktopEnvironment::Cinnamon.gtk());
assert!(DesktopEnvironment::Cosmic.gtk());
assert!(DesktopEnvironment::Gnome.gtk());
assert!(DesktopEnvironment::Lxde.gtk());
assert!(DesktopEnvironment::Mate.gtk());
assert!(DesktopEnvironment::Unity.gtk());
assert!(DesktopEnvironment::Xfce.gtk());
// Non-GTK examples
assert!(!DesktopEnvironment::Kde.gtk());
assert!(!DesktopEnvironment::Windows.gtk());
sourcepub const fn qt(self) -> bool
pub const fn qt(self) -> bool
Test if the desktop environment is based on the Qt framework
use detect_desktop_environment::DesktopEnvironment;
// All matching desktop environments:
assert!(DesktopEnvironment::Kde.qt());
assert!(DesktopEnvironment::Lxqt.qt());
// Non-Qt examples
assert!(!DesktopEnvironment::Gnome.qt());
assert!(!DesktopEnvironment::Windows.qt());
Trait Implementations§
source§impl Clone for DesktopEnvironment
impl Clone for DesktopEnvironment
source§fn clone(&self) -> DesktopEnvironment
fn clone(&self) -> DesktopEnvironment
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DesktopEnvironment
impl Debug for DesktopEnvironment
source§impl Hash for DesktopEnvironment
impl Hash for DesktopEnvironment
source§impl Ord for DesktopEnvironment
impl Ord for DesktopEnvironment
source§fn cmp(&self, other: &DesktopEnvironment) -> Ordering
fn cmp(&self, other: &DesktopEnvironment) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<DesktopEnvironment> for DesktopEnvironment
impl PartialEq<DesktopEnvironment> for DesktopEnvironment
source§fn eq(&self, other: &DesktopEnvironment) -> bool
fn eq(&self, other: &DesktopEnvironment) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<DesktopEnvironment> for DesktopEnvironment
impl PartialOrd<DesktopEnvironment> for DesktopEnvironment
source§fn partial_cmp(&self, other: &DesktopEnvironment) -> Option<Ordering>
fn partial_cmp(&self, other: &DesktopEnvironment) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more