Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaust committed Jan 8, 2025
1 parent 4fc073e commit 1c7de49
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 26 deletions.
12 changes: 4 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = ["gui"]
default = []
serde = ["muda/serde", "dep:serde"]
common-controls-v6 = ["muda/common-controls-v6"]
linux-ksni = ["muda/linux-ksni"]
linux-ksni = ["dep:ksni", "dep:arc-swap", "muda/linux-ksni"]

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

[target."cfg(target_os = \"linux\")".dependencies]
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"
arc-swap = { version = "1.7.1", optional = true }
ksni = { version = "0.2.2", optional = true }
dirs = "5"

[target."cfg(target_os = \"linux\")".dev-dependencies]
gtk = "0.18"
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,18 @@ tray-icon lets you create tray icons for desktop applications.

## 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.
On Linux, `gtk`, `libappindicator` or `libayatana-appindicator` are used to create the tray icon. When using the `linux-ksni` feature, `libdbus-1-dev` is needed as well. So make sure to install these packages on your system.

#### Arch Linux / Manjaro:

```sh
pacman -S gtk3 libappindicator-gtk3 # or libayatana-appindicator
# or
pacman -S gtk3 dbus
pacman -S gtk3 libappindicator-gtk3 # or `libayatana-appindicator` and optionally `dbus`
```

#### Debian / Ubuntu:

```sh
sudo apt install libgtk-3-dev libappindicator3-dev # or libayatana-appindicator3-dev
# or
sudo apt install libgtk-3-dev libdbus-1-dev
sudo apt install libgtk-3-dev libappindicator3-dev # or `libayatana-appindicator3-dev` and optionally `libdbus-1-dev`
```

## Examples
Expand Down
18 changes: 7 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,25 @@
//! - 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.
//! On Linux, `gtk`, `libappindicator` or `libayatana-appindicator` are used to create the tray icon. When using the `linux-ksni` feature, `libdbus-1-dev` is needed as well. So make sure to install these packages on your system.
//!
//! #### Arch Linux / Manjaro:
//!
//! ```sh
//! pacman -S gtk3 libappindicator-gtk3 # or libayatana-appindicator
//! # or
//! pacman -S gtk3 dbus
//! pacman -S gtk3 libappindicator-gtk3 # or `libayatana-appindicator` and optionally `dbus`
//! ```
//!
//! #### Debian / Ubuntu:
//!
//! ```sh
//! sudo apt install libgtk-3-dev libappindicator3-dev # or libayatana-appindicator3-dev
//! # or
//! sudo apt install libgtk-3-dev libdbus-1-dev
//! sudo apt install libgtk-3-dev libappindicator3-dev # or `libayatana-appindicator3-dev` and optionally `libdbus-1-dev`
//! ```
//!
//! # Examples
Expand Down Expand Up @@ -288,7 +284,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 +399,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 1c7de49

Please sign in to comment.