5 releases (3 stable)
1.2.0 | Jan 3, 2025 |
---|---|
1.1.0 | Apr 16, 2024 |
1.0.0 | Mar 18, 2023 |
0.2.0 | Dec 2, 2017 |
0.1.0 | Dec 2, 2017 |
#103 in GUI
17,362 downloads per month
21KB
221 lines
Detect Desktop Environment
This crate helps you to detect the current desktop environment.
It was inspired by the detectDE
function from xdg-util.
Installation
Run the following command in your project:
cargo add detect-desktop-environment
Usage
use detect_desktop_environment::DesktopEnvironment;
fn main() {
match DesktopEnvironment::detect() {
Some(de) => println!("detected desktop environment: {de:?}"),
None => println!("failed to detect desktop environment"),
}
}
This library exposes two symbols: the detect
function and it returns value: the
DesktopValue
enum. All the variants are listed below in the "Supported environments"
section.
Supported environments
Name | Thumbnail |
---|---|
Cinnamon |
![]() |
Cosmic |
![]() |
Cosmic Epoch |
![]() |
Dde |
![]() |
Ede |
![]() |
Endless |
![]() |
Enlightenment |
![]() |
Gnome |
![]() |
Hyprland |
![]() |
Kde |
![]() |
Lxde |
![]() |
Lxqt |
![]() |
MacOs |
![]() |
Mate |
![]() |
Old |
![]() |
Pantheon |
![]() |
Razor |
![]() |
Rox |
![]() |
Sway |
![]() |
Tde |
![]() |
Unity |
![]() |
Windows |
![]() |
Xfce |
![]() |
Documentation
See docs.rs/detect-desktop-environment.
Maintenance status
This library is stable and no major changes are expected.
If you want to improve the library, feel free to open an issue or send a PR. Breaking changes are allowed. Note however that review times may be slow.
Minimum Supported Rust Version (MSRV) policy
The last 8 stable versions are explicitly supported (1 year). See Cargo.toml for details.