Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -",
"prepublish": [
"sudo apt-get update",
"sudo apt-get install -y libgtk-3-dev libxdo-dev libayatana-appindicator3-dev"
"sudo apt-get install -y libgtk-3-dev libayatana-appindicator3-dev libdbus-1-dev"
],
"publish": [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clippy-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxdo-dev libayatana-appindicator3-dev
sudo apt-get install -y libgtk-3-dev libayatana-appindicator3-dev libdbus-1-dev

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxdo-dev libayatana-appindicator3-dev
sudo apt-get install -y libgtk-3-dev libayatana-appindicator3-dev libdbus-1-dev

- uses: dtolnay/rust-toolchain@1.71
- run: cargo build
Expand Down
151 changes: 128 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ categories = ["gui"]
rust-version = "1.71"

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

[dependencies]
muda = { version = "0.15", default-features = false }
Expand All @@ -34,6 +34,8 @@ features = [

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

[target."cfg(target_os = \"linux\")".dev-dependencies]
Expand Down Expand Up @@ -88,3 +90,6 @@ tao = "0.31"
image = "0.25"
eframe = "0.30"
serde_json = "1"

[patch.crates-io]
muda = { git = "https://github.com/dfaust/muda", branch = "ksni" }
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ tray-icon lets you create tray icons for desktop applications.

- Windows
- macOS
- Linux (gtk Only)
- Linux

## Platform-specific notes:

- On Windows and Linux, an event loop must be running on the thread, on Windows, a win32 event loop and on Linux, a gtk event loop. It doesn't need to be the main thread but you have to create the tray icon on the same thread as the event loop.
- 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.

### Cargo Features
## Cargo Features

- `common-controls-v6`: Use `TaskDialogIndirect` API from `ComCtl32.dll` v6 on Windows for showing the predefined `About` menu item dialog.
- `libxdo`: Enables linking to `libxdo` which is used for the predfined `Copy`, `Cut`, `Paste` and `SelectAll` menu item, see https://github.com/tauri-apps/muda#cargo-features
- `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`, `libxdo` is used to make the predfined `Copy`, `Cut`, `Paste` and `SelectAll` menu items work and `libappindicator` or `libayatnat-appindicator` are used to create the tray icon, so make sure to install them 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 xdotool libappindicator-gtk3 #or libayatana-appindicator
pacman -S gtk3 libappindicator-gtk3 # or `libayatana-appindicator` and optionally `dbus`
```

#### Debian / Ubuntu:

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

## Examples
Expand Down
Loading