Skip to content

Commit

Permalink
Add default linux-gtk feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaust committed Jan 8, 2025
1 parent 4fc073e commit 998861b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
15 changes: 6 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ license = "MIT OR Apache-2.0"
categories = ["gui"]

[features]
default = []
default = ["linux-gtk"]
serde = ["muda/serde", "dep:serde"]
common-controls-v6 = ["muda/common-controls-v6"]
linux-ksni = ["muda/linux-ksni"]
linux-gtk = ["dep:libappindicator"]
linux-ksni = ["dep:ksni", "dep:arc-swap", "muda/linux-ksni"]

[dependencies]
muda = { version = "0.15", default-features = false }
Expand All @@ -32,15 +33,11 @@ features = [
]

[target."cfg(target_os = \"linux\")".dependencies]
libappindicator = { version = "0.9", optional = true }
arc-swap = { version = "1.7.1", optional = true }
ksni = { version = "0.2.2", optional = true }
dirs = "5"

[target."cfg(all(target_os = \"linux\", not(feature = \"linux-ksni\")))".dependencies]
libappindicator = "0.9"

[target."cfg(all(target_os = \"linux\", feature = \"linux-ksni\"))".dependencies]
arc-swap = "1.7.1"
ksni = "0.2.2"

[target."cfg(target_os = \"linux\")".dev-dependencies]
gtk = "0.18"

Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
//! - On macOS, an event loop must be running on the main thread so you also need to create the tray icon on the main thread. You must make sure that the event loop is already running and not just created before creating a TrayIcon to prevent issues with fullscreen apps. In Winit for example the earliest you can create icons is on [`StartCause::Init`](https://docs.rs/winit/latest/winit/event/enum.StartCause.html#variant.Init).
//!
//! # Cargo Features
//!
//!
//! - `common-controls-v6`: Use `TaskDialogIndirect` API from `ComCtl32.dll` v6 on Windows for showing the predefined `About` menu item dialog.
//! - `serde`: Enables de/serializing derives.
//! - `linux-ksni`: Use ksni and the xdg standard to create and manage tray icons on Linux. (experimental)
//!
//!
//! # Dependencies (Linux Only)
//!
//! On Linux, `gtk` is required. `libappindicator` or `libayatana-appindicator` are used to create the tray icon. Alternatively `libdbus-1-dev` is used to communicate with the desktop environment to manage the tray icon, if the `linux-ksni` feature is enabled. So make sure to install these packages on your system.
Expand Down Expand Up @@ -288,7 +288,7 @@ impl TrayIconBuilder {
}

/// Set tray icon temp dir path. **Linux only**.
///
///
/// Not availabe with feature `linux-ksni`.
///
/// On Linux, we need to write the icon to the disk and usually it will
Expand Down Expand Up @@ -403,7 +403,7 @@ impl TrayIcon {
}

/// Sets the tray icon temp dir path. **Linux only**.
///
///
/// Not availabe with feature `linux-ksni`.
///
/// On Linux, we need to write the icon to the disk and usually it will
Expand Down

0 comments on commit 998861b

Please sign in to comment.