1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//! # freedesktop
//!
//! Rust implementations of the freedesktop.org specifications for Linux desktop integration.
//!
//! This crate provides a unified interface to freedesktop standards through optional features.
//!
//! ## Features
//!
//! - **`core`** (default) - XDG base directories and desktop environment detection
//! - **`apps`** (default) - Desktop Entry parsing and application execution
//! - **`icon`** (default) - Icon theme support and icon lookup
//! - **`cli`** - Command-line utilities (enables `apps`)
//!
//! ## Quick Start
//!
//! ### XDG Base Directories
//!
//! ```rust
//! # #[cfg(feature = "core")]
//! # {
//! use freedesktop::base_directories;
//!
//! for dir in base_directories() {
//! println!("XDG data directory: {}", dir.display());
//! }
//! # }
//! ```
//!
//! ### Desktop Applications
//!
//! ```rust
//! # #[cfg(feature = "apps")]
//! # {
//! use freedesktop::ApplicationEntry;
//!
//! // List all applications
//! for app in ApplicationEntry::all() {
//! if app.should_show() {
//! println!("{}: {}", app.id().unwrap_or_default(), app.name().unwrap_or_default());
//! }
//! }
//!
//! // Parse a desktop file (would normally execute an app)
//! # let desktop_content = "[Desktop Entry]\nType=Application\nName=Test App\nExec=test-app\n";
//! # std::fs::write("/tmp/test.desktop", desktop_content).unwrap();
//! let app = ApplicationEntry::try_from_path("/tmp/test.desktop").unwrap();
//! // app.execute().unwrap(); // Would launch the application
//! # std::fs::remove_file("/tmp/test.desktop").ok();
//! # }
//! ```
//!
//! ### Icon Themes
//!
//! ```rust
//! # #[cfg(feature = "icon")]
//! # {
//! use freedesktop::{IconTheme, get_icon};
//!
//! // Get the current icon theme
//! let theme = IconTheme::current();
//! println!("Current theme: {}", theme.name());
//!
//! // Find an icon
//! if let Some(icon_path) = get_icon("firefox") {
//! println!("Firefox icon: {}", icon_path.display());
//! }
//! # }
//! ```
//!
//! ## Feature Usage
//!
//! ```toml
//! # Default - includes core, apps, and icon
//! freedesktop = "0.1.0"
//!
//! # Only XDG base directories
//! freedesktop = { version = "0.1.0", default-features = false, features = ["core"] }
//!
//! # Only desktop applications (automatically includes core)
//! freedesktop = { version = "0.1.0", default-features = false, features = ["apps"] }
//!
//! # Icon theme support (automatically includes core)
//! freedesktop = { version = "0.1.0", default-features = false, features = ["icon"] }
//! ```
// Re-export core functionality
pub use *;
// Re-export apps functionality
pub use *;
pub use *;