detect-desktop-environment

Crates.iodetect-desktop-environment
lib.rsdetect-desktop-environment
version1.1.0
sourcesrc
created_at2017-12-02 19:31:33.782225
updated_at2024-04-16 18:17:52.864676
descriptionAutodetect the desktop environment
homepagehttps://github.com/demurgos/detect-desktop-environment
repositoryhttps://github.com/demurgos/detect-desktop-environment
max_upload_size
id41379
size1,362,139
Charles Samborski (demurgos)

documentation

https://docs.rs/detect-desktop-environment/latest/detect_desktop_environment/

README

Detect Desktop Environment

GitHub crates.io CI status docs.rs/detect-desktop-environment license MIT

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 Cinnamon
Cosmic COSMIC
Dde Deepin DE
Ede EDE
Endless Endless
Enlightenment Enlightenment
Gnome Gnome
Hyprland Hyprland
Kde Kde
Lxde Lxde
Lxqt Lxqt
MacOs MacOs
Mate Mate
Old Old
Pantheon Pantheon
Razor Razor
Rox Rox
Sway Sway
Tde Tde
Unity Unity
Windows Windows
Xfce 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.

License

MIT

Commit count: 18

cargo fmt