commit 8f476dbe522286d57434cd235f94a16ad3e192a0 Author: X4Lo Date: Sat Nov 14 04:26:05 2026 +0000 feat: HushKey 1.0.0 — per-app mute hotkeys for Windows, macOS and Linux Native Rust tray app that binds global shortcuts to mute/unmute individual applications' audio, plus a Mute All / Restore All shortcut. - AudioController trait with per-OS backends: WASAPI sessions (Windows), Core Audio process taps (macOS 14.2+, mute only), PulseAudio/PipeWire sink inputs (Linux) - Dedicated audio thread; hotkey presses go straight to it - Snapshot-based Mute All that restores exactly the previous state - Slint UI with software renderer; window destroyed on close - Non-activating on-screen confirmation and tray icon flash - TOML config, launch at login, start minimized, dark/light theme - Procedurally drawn icon embedded into the Windows executable - Docs, AGENTS.md, CLAUDE.md, contributing guide and CI for all three OSes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cc0d8c2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto eol=lf +*.webp binary +*.png binary +*.ico binary diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..6e9f3ce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,47 @@ +name: Bug report +description: Something doesn't work as expected +labels: [bug] +body: + - type: dropdown + id: os + attributes: + label: Operating system + options: [Windows, macOS, Linux] + validations: + required: true + - type: input + id: os-version + attributes: + label: OS version + placeholder: "Windows 11 23H2 / macOS 15.1 (Apple Silicon) / Ubuntu 24.04" + validations: + required: true + - type: input + id: linux-session + attributes: + label: "Linux only: session, desktop and audio server" + placeholder: "wayland, GNOME 46, PipeWire (pactl info | grep 'Server Name')" + - type: input + id: version + attributes: + label: HushKey version + description: Settings → About + validations: + required: true + - type: textarea + id: what + attributes: + label: What happened? + description: What you pressed, what you expected, what actually happened. Mention your keyboard layout for shortcut issues. + validations: + required: true + - type: textarea + id: list + attributes: + label: Output of `hushkey --list` + render: text + - type: textarea + id: logs + attributes: + label: Logs (`RUST_LOG=hushkey=debug`) + render: text diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..e102351 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,22 @@ +name: Feature request +description: Suggest an idea +labels: [enhancement] +body: + - type: textarea + id: problem + attributes: + label: What problem would this solve? + validations: + required: true + - type: textarea + id: idea + attributes: + label: Proposed solution + - type: checkboxes + id: platforms + attributes: + label: Which platforms does this matter on? + options: + - label: Windows + - label: macOS + - label: Linux diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..a821cc8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,7 @@ +## What & why + +## Tested on + + +- [ ] `cargo fmt`, `cargo clippy --all-targets -- -D warnings` and `cargo test` pass +- [ ] Docs updated if behaviour or platform support changed diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..490035e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, macos-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + - name: Linux system dependencies + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y pkg-config libpulse-dev libfontconfig1-dev libxkbcommon-dev + - name: Format + run: cargo fmt --all --check + - name: Clippy + run: cargo clippy --all-targets -- -D warnings + - name: Test + run: cargo test + - name: Release build + run: cargo build --release + - uses: actions/upload-artifact@v4 + with: + name: hushkey-${{ runner.os }} + path: | + target/release/hushkey + target/release/hushkey.exe + if-no-files-found: ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7531bac --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/target +**/*.rs.bk +*.pdb +.DS_Store +.idea/ +.vscode/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..f76d4eb --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,79 @@ +# AGENTS.md + +Guidance for AI coding agents working in this repository. Human contributors: see [CONTRIBUTING.md](CONTRIBUTING.md). + +## What this is + +HushKey is a Rust tray app that binds **global keyboard shortcuts** to **mute/unmute individual applications' audio**, plus a Mute All shortcut. One codebase for Windows, macOS and Linux. The UI is [Slint](https://slint.dev) with the **software renderer**. **Do not introduce a webview (Tauri, wry, Electron) or a GPU renderer**: low idle memory is a core product requirement. + +## Project structure + +``` +src/ + main.rs CLI flags, single-instance guard, Slint backend selection, event loop + app.rs main-thread controller (config, hotkeys, tray, toast, window lifecycle) + platform.rs launch-at-login, open-folder, single-instance socket + audio/ + mod.rs AudioController trait, AudioApp/AppKey/AudioError, create_controller() + mute.rs MuteManager: toggle / mute-all / restore-all semantics ← unit tests + worker.rs audio thread; AudioCommand in, AudioEvent out + windows.rs Windows backend: WASAPI IAudioSessionManager2 / ISimpleAudioVolume + macos.rs macOS backend: Core Audio process taps (14.2+), mute-only + linux.rs Linux backend: libpulse sink inputs (works on PipeWire) + null.rs in-memory backend for tests / unsupported OSes + hotkeys/ + accelerator.rs Accelerator type, "Ctrl+Alt+S" format, Slint key → shortcut ← unit tests + mod.rs Hotkeys: register config bindings, suspend during capture + config/mod.rs Config + ConfigStore (TOML, atomic writes) ← unit tests + ui/ + mod.rs helpers (avatar tint, initials, icon conversion) + icon.rs procedural app/tray icon rasteriser ← unit tests + tray.rs tray icon + menu + toast.rs non-activating on-screen confirmation window +ui/ .slint files (main.slint, widgets.slint, theme.slint, toast.slint) +build.rs compiles ui/main.slint (fluent style) +docs/ architecture.md, building.md, design-decisions.md +``` + +## Build / run / test + +| Task | Command | +|---|---| +| Build (debug) | `cargo build` | +| Run | `cargo run` (window opens) · `cargo run -- --minimized` (tray only) | +| List detected audio apps | `cargo run -- --list` | +| Unit tests | `cargo test` | +| Lint | `cargo clippy --all-targets -- -D warnings` | +| Format | `cargo fmt` | +| Release | `cargo build --release` (fat LTO; slow, a few minutes) | +| Type-check macOS from anywhere | `rustup target add aarch64-apple-darwin && cargo check --target aarch64-apple-darwin` | + +Per-OS system dependencies are in [docs/building.md](docs/building.md). On Linux you need `libpulse-dev`, `libfontconfig1-dev`, `libxkbcommon-dev` and `pkg-config`. + +Tests don't touch real audio devices: they use `audio::null::NullController`. Backend code can only be verified by running the app on that OS. Say clearly which OS you actually ran on. + +## Conventions + +- **Platform code stays in `src/audio/.rs`** (and small `cfg` blocks in `platform.rs`, `ui/toast.rs`, `main.rs`). Everything else must compile and behave identically on all OSes. +- **New capabilities go through the `AudioController` trait.** Never call an OS audio API from `app.rs` or the UI. +- **Backends are created on the audio thread** and are not `Send`. Don't move them across threads or put them in `Arc>`. +- **Never fake a capability.** If an OS can't do something (macOS volume levels), return `AudioError::Unsupported`, set `Capabilities` accordingly, and explain it in the module doc comment, `platform_note()`, and `docs/design-decisions.md`. +- **Mute with the mixer's mute flag**, not by setting volume to 0 (crash-safety; see design-decisions). +- Errors: `AudioResult` in audio code; user-facing strings go through `App::set_status` or the toast. No `unwrap()` on OS calls. +- UI strings live in `.slint` files; keep them short, sentence case. +- Slint gotcha: `row`, `col`, `x`, `y`, `width`, `height` are built-in properties. Don't name custom properties after them. +- Formatting: `rustfmt.toml` (max width 120). Run `cargo fmt` before finishing. +- Commit messages: Conventional Commits (`feat(audio): …`, `fix(ui): …`). + +## Gotchas + +- **Hotkeys must be registered on the main thread** (Windows: the message-loop thread; macOS: requires the main run loop). `Hotkeys` is created in `App::start`. +- **While recording a shortcut, all hotkeys are unregistered** (`Hotkeys::suspend`). Forgetting to call `end_capture` leaves the user with no working shortcuts. +- **The tray must be created after the event loop starts** (macOS requirement). It's done in a zero-delay `slint::Timer`. +- **The toast must never take focus.** It relies on `ui::toast::window_attributes_hook` and the thread-local `NEXT_WINDOW_IS_TOAST` flag set immediately before `Toast::new()`. Any new window type created between those calls would inherit the toast attributes. +- **The main window is dropped on close** (`App::release_window`). Never hold a strong `MainWindow` handle in a closure. Use `with_app(|a| ...)` from callbacks. +- **Windows COM:** `WasapiController` initialises COM (MTA) on the audio thread and uninitialises in `ComGuard`, which must remain the **last** struct field. +- **macOS:** tap functions are resolved with `dlsym`. Don't link them directly or the app won't launch on macOS < 14.2. Muting requires the Screen & System Audio Recording permission plus `NSAudioCaptureUsageDescription` in the bundle's Info.plist. +- **Linux:** global hotkeys are X11-only. Under Wayland they appear to register but don't fire for native Wayland windows. +- **Permissions summary:** Windows needs none. macOS needs audio-capture permission for muting (no Accessibility permission for hotkeys). Linux needs an X11 session for hotkeys and a StatusNotifierItem host for the tray. +- The single-instance guard binds `127.0.0.1:47219`. A second launch asks the first to show its window and exits. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..2ecf5a3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,48 @@ +# CLAUDE.md + +This file guides Claude Code when working in this repository. The full agent guide is [AGENTS.md](AGENTS.md); read it first. This file covers the essentials and what needs extra care. + +## Project overview + +HushKey: a native Rust tray app (Windows/macOS/Linux) that binds global shortcuts to mute/unmute individual apps' audio, plus a Mute All shortcut. UI is Slint with the software renderer; minimal idle memory is a hard requirement. **No webviews (Tauri/wry), no GPU renderers.** + +## Key commands + +```bash +cargo build # debug build +cargo run # run with window; `-- --minimized` for tray only +cargo run -- --list # print detected audio apps (real devices) +cargo test # unit tests (no audio hardware needed) +cargo clippy --all-targets -- -D warnings # lint +cargo fmt # format (rustfmt.toml, width 120) +cargo check --target aarch64-apple-darwin # type-check the macOS backend from Windows/Linux +``` + +## Architecture pointers + +- `src/audio/mod.rs`: the `AudioController` trait. All OS audio code is behind it. +- `src/audio/{windows,macos,linux}.rs`: one backend per OS. `null.rs` is the test double. +- `src/audio/mute.rs`: toggle / Mute All / Restore All rules (snapshot-based restore). +- `src/audio/worker.rs`: the audio thread. Hotkey presses are sent here directly, bypassing the UI. +- `src/app.rs`: main-thread controller. `with_app(|a| ...)` is how callbacks reach it. +- `ui/*.slint`: the UI. `build.rs` compiles `ui/main.slint`. +- Docs: `docs/architecture.md`, `docs/design-decisions.md` (platform limitations), `docs/building.md`. + +## Be careful when editing audio backend code + +- **Keep platform code inside `src/audio/.rs`.** Don't call OS audio APIs from `app.rs`/UI; extend the trait instead. +- **Backends live on the audio thread and are `!Send` by design** (COM apartment, PulseAudio mainloop, Core Audio taps). Don't wrap them in `Arc>` or move them. +- **Mute via the mixer mute flag, never by setting volume to 0.** This keeps the user's level and is crash-safe. +- **Group by `AppKey`, never by PID.** Bindings must survive restarts; one key controls all of an app's sessions. +- **Never fake unsupported features.** macOS can't set per-app volume: return `AudioError::Unsupported`, keep `Capabilities` honest, and document it. +- **Windows:** `ComGuard` must stay the last field of `WasapiController` (field drop order = COM release before `CoUninitialize`). Enumerate sessions on *all* active render devices, not just the default. +- **macOS:** resolve `AudioHardwareCreateProcessTap`/`DestroyProcessTap` via `dlsym`. Linking them directly breaks launch on macOS < 14.2. Taps must be destroyed in `Drop`. +- **Linux:** every PulseAudio operation must be driven to completion with `wait()` on the same thread. +- You can only truly verify a backend by running `cargo run -- --list` and muting on that OS. State plainly which OS you tested on; macOS and Linux changes made from Windows are compile-checked at best. +- Don't send synthetic keyboard/mouse input to test the UI on a developer's live desktop. Ask them to try it instead. + +## Other gotchas + +- Shortcut recording calls `Hotkeys::suspend()`. Every exit path must reach `App::end_capture()` so hotkeys are re-registered. +- The toast window depends on the `NEXT_WINDOW_IS_TOAST` flag consumed by the winit attributes hook in `src/ui/toast.rs`. Keep it non-activating so it never steals focus from games. +- Slint reserves property names like `row`, `col`, `x`, `y`. Pick other names. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d79c6f4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,60 @@ +# Contributing to HushKey + +Thanks for helping! HushKey spans three operating systems with very different audio stacks, so testing on real machines is the most valuable contribution of all. A bug report from a Mac or a Wayland desktop is genuinely useful. + +## Development setup + +1. Install stable Rust via [rustup](https://rustup.rs). +2. Install your platform's system dependencies, listed in [docs/building.md](docs/building.md). +3. Clone and run: + + ```bash + git clone https://github.com/X4Lo/HushKey.git + cd HushKey + cargo run + ``` + +4. Useful while developing: + + ```bash + cargo test # unit tests, no audio hardware needed + cargo run -- --list # what does the backend see on this machine? + RUST_LOG=hushkey=debug cargo run # verbose logs + ``` + +Read [docs/architecture.md](docs/architecture.md) before changing anything under `src/audio/` or `src/app.rs`. + +## Coding style + +- `cargo fmt` (config in `rustfmt.toml`) and `cargo clippy --all-targets -- -D warnings` must pass. CI enforces both. +- Keep OS-specific code in `src/audio/.rs` behind the `AudioController` trait. Small `#[cfg]` blocks elsewhere are fine when unavoidable (window attributes, tray quirks). +- Don't fake capabilities a platform lacks. Return `AudioError::Unsupported` and document the limitation in the module comment, `platform_note()` and `docs/design-decisions.md`. +- No `unwrap()`/`expect()` on OS or I/O calls in app code. Surface errors to the user via the status banner or toast. +- Pure logic (parsing, state machines) gets unit tests next to the code (`#[cfg(test)] mod tests`). +- UI: edit `ui/*.slint`. Use `Theme` tokens from `ui/theme.slint` instead of hard-coded colours, and set accessibility properties (`accessible-role`, `accessible-label`) on interactive elements. +- Keep the idle footprint small: no polling while the window is hidden, no new background threads without a good reason, no webviews or GPU renderers. + +## Branches and pull requests + +- Branch from `main`: `feat/`, `fix/`, `docs/`. +- Commit messages follow [Conventional Commits](https://www.conventionalcommits.org): `feat(audio): …`, `fix(macos): …`, `docs: …`. +- Keep PRs focused: one feature or fix per PR. +- In the PR description, **list the OSes you actually ran the change on** (e.g. "Tested: Windows 11 24H2. Compile-checked: macOS. Not tested: Linux"). Reviewers rely on this, because CI can only build and run unit tests. +- Update the docs when behaviour or platform support changes (README capability table, `docs/`). +- CI must be green on all three OSes before merge. + +## Reporting bugs + +Please use the issue templates. Platform-specific details matter more than usual here: + +- **OS and version**, e.g. Windows 11 23H2, macOS 15.1 (Apple Silicon), Ubuntu 24.04. +- **Linux:** session type (`echo $XDG_SESSION_TYPE`), desktop environment, and audio server (`pactl info | grep "Server Name"`). +- **macOS:** whether HushKey was run from an app bundle, and whether *Screen & System Audio Recording* permission is granted. +- **HushKey version**, shown in Settings → About. +- **Output of `hushkey --list`** while the problem app is playing. +- **Logs:** run with `RUST_LOG=hushkey=debug` and attach the output. On Windows release builds, redirect to a file: `hushkey.exe > log.txt 2>&1`. +- What you pressed, what you expected, and what happened. For shortcut problems, say which keyboard layout you use. + +## Security + +Please report security issues privately via GitHub's "Report a vulnerability" feature rather than a public issue. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..af722be --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,6252 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ab_glyph" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" + +[[package]] +name = "accesskit" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b7f7f85a7e5f68090000ed7622545829afd484d210358702ae4cb97dd0c320" +dependencies = [ + "uuid", +] + +[[package]] +name = "accesskit_atspi_common" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "023da0e5097f46df7092d5280b02efb9bbf8d93298daeced42652463e357d636" +dependencies = [ + "accesskit", + "accesskit_consumer", + "atspi-common", + "phf", + "serde", + "zvariant", +] + +[[package]] +name = "accesskit_consumer" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d10a236f96f87d70732e44520046785431ef01d5bcd6b041317bfadd2f88245" +dependencies = [ + "accesskit", + "hashbrown 0.16.1", +] + +[[package]] +name = "accesskit_ios" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "750c4e9f6ce888dfe8a10c0f1b5ceb646a7854fd46579d74919219d1bb314083" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown 0.16.1", + "objc2 0.5.3", + "objc2-foundation 0.2.2", + "objc2-ui-kit 0.2.2", +] + +[[package]] +name = "accesskit_macos" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce02dc63b43f0c9296af9ac946312a2dc8814427d7a64d2d600971dac55b6076" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown 0.16.1", + "objc2 0.5.3", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "accesskit_unix" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e156ed3802e35eefe894ef2671bc6c889303d8a7e110b5e1b48f504b91362f" +dependencies = [ + "accesskit", + "accesskit_atspi_common", + "async-channel", + "async-executor", + "async-task", + "atspi", + "futures-lite", + "futures-util", + "serde", + "zbus", +] + +[[package]] +name = "accesskit_windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106c2b961215864d1c2e703ee63269c25c4e80a577ffb2c1017b9c17dcdf83a1" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown 0.16.1", + "static_assertions", + "windows", + "windows-core", +] + +[[package]] +name = "accesskit_winit" +version = "0.33.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5b41e63a69f36d9f1f41e70464c7e5f72eee485ef26aab19f0b4f86e6c0a84c" +dependencies = [ + "accesskit", + "accesskit_ios", + "accesskit_macos", + "accesskit_unix", + "accesskit_windows", + "raw-window-handle", + "winit", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-activity" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f2a1bb052857d5dd49572219344a7332b31b76405648eabac5bc68978251bcd" +dependencies = [ + "android-properties", + "bitflags 2.13.2", + "cc", + "jni", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "num_enum", + "thiserror 2.0.21", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "annotate-snippets" +version = "0.12.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0258346f92c78dbc5b336b9a5b27c64447aa10643bc64e651db2edb145361564" +dependencies = [ + "anstyle", + "memchr", + "unicode-width", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "arboard" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb9553e62312c8756a5979254fc6d7da8bbeb5986a1e17037fab932f7037917" +dependencies = [ + "clipboard-win", + "log", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "parking_lot", + "percent-encoding", + "windows-sys 0.61.2", + "wl-clipboard-rs", + "x11rb", +] + +[[package]] +name = "arc-swap" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b5d51209f6de83d37a0b33d320acb8da88823e42a94c075140708f032a5" +dependencies = [ + "rustversion", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f426a31126c735126297bc5ea7a521263c9faff4f63ca415267ee625651c4f37" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix 1.1.6", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0876700b0d007ad25d5508865a4259c3af9af6d296bf663a0d586d0bc3369f6f" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix 1.1.6", +] + +[[package]] +name = "async-recursion" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "async-signal" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 1.1.6", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atspi" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77886257be21c9cd89a4ae7e64860c6f0eefca799bb79127913052bd0eefb3d" +dependencies = [ + "atspi-common", + "atspi-proxies", +] + +[[package]] +name = "atspi-common" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20c5617155740c98003016429ad13fe43ce7a77b007479350a9f8bf95a29f63d" +dependencies = [ + "enumflags2", + "serde", + "static_assertions", + "zbus", + "zbus-lockstep", + "zbus-lockstep-macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "atspi-proxies" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2230e48787ed3eb4088996eab66a32ca20c0b67bbd4fd6cdfe79f04f1f04c9fc" +dependencies = [ + "atspi-common", + "serde", + "zbus", +] + +[[package]] +name = "auto-launch" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17918dba7ecf78b9a14507ec9f984e7977d13fad87dc86d61038980a45d128cf" +dependencies = [ + "dirs", + "os_info", + "smappservice-rs", + "thiserror 2.0.21", + "windows-registry", + "windows-result", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + +[[package]] +name = "bincode" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" +dependencies = [ + "serde", + "unty", +] + +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags 2.13.2", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 2.1.3", + "shlex 1.3.0", + "syn 2.0.119", +] + +[[package]] +name = "bit-set" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2f926cc3060f09db9ebc5b52823d85268d24bb917e472c0c4bea35780a7d" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" +dependencies = [ + "serde_core", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2 0.5.3", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2 0.6.5", +] + +[[package]] +name = "blocking" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "borsh" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a" +dependencies = [ + "bytes", + "cfg_aliases", +] + +[[package]] +name = "bumpalo" +version = "3.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" + +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a1f896587b6f2c069c73d2f0913e2d590c3990285cd2f0b6aa02b786b4c679c" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.13.2", + "log", + "polling", + "rustix 0.38.44", + "slab", + "thiserror 1.0.69", +] + +[[package]] +name = "calloop" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b32313e937c8721c9d17ee9bf60699a6402b4b7c2cb6ac1bee0ffcaa4b4e5e" +dependencies = [ + "bitflags 2.13.2", + "polling", + "rustix 1.1.6", + "tracing", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop 0.13.0", + "rustix 0.38.44", + "wayland-backend", + "wayland-client", +] + +[[package]] +name = "cc" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ef9e3e8154a45c7a95cff4c1299702106ad94062d7bb85fdc5d3a5afd91d45" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex 2.0.1", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom 7.1.3", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clipboard-win" +version = "5.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052af7878466feccda12ba7a6a67d019d712f296809559b47c12c8cc196d3a9a" +dependencies = [ + "error-code", +] + +[[package]] +name = "clru" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197fd99cb113a8d5d9b6376f3aa817f32c1078f2343b714fff7d2ca44fdf67d5" +dependencies = [ + "hashbrown 0.16.1", +] + +[[package]] +name = "codespan-reporting" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "combine" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-field-offset" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d535c69e75b4e3c69e17205b5b37a91936c54086cecd339b70071500786acb9c" +dependencies = [ + "const-field-offset-macro", + "field-offset", +] + +[[package]] +name = "const-field-offset-macro" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d5848843a221ac268cfdd6bfd14e68d5d3dfa79d52c880aafab93f9517fb74" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "countme" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636" + +[[package]] +name = "crc32fast" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "ctor" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83cf0d42651b16c6dfe68685716d18480d18a9c39c62d76e8cf3eb6ed5d8bcbf" +dependencies = [ + "dtor", +] + +[[package]] +name = "cursor-icon" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" + +[[package]] +name = "data-url" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", + "unicode-xid", +] + +[[package]] +name = "directories" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "dlib" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" +dependencies = [ + "libloading", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" + +[[package]] +name = "drm" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "libc", + "rustix 0.38.44", +] + +[[package]] +name = "drm-ffi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51a91c9b32ac4e8105dec255e849e0d66e27d7c34d184364fb93e469db08f690" +dependencies = [ + "drm-sys", + "rustix 1.1.6", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8e1361066d91f5ffccff060a3c3be9c3ecde15be2959c1937595f7a82a9f8" +dependencies = [ + "libc", + "linux-raw-sys 0.9.4", +] + +[[package]] +name = "dtor" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf234dd1594d6dd434a8fb8cada51ddbbc593e40e4a01556a0b31c62da2775b" + +[[package]] +name = "either" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "env_filter" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "errno" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "error-code" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5343afd4a8365a643ac588dab4cf234a190c7f6c88c9f6dd6ffe00837661b7" + +[[package]] +name = "euclid" +version = "0.22.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06" +dependencies = [ + "num-traits", +] + +[[package]] +name = "event-listener" +version = "5.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" +dependencies = [ + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "filetime" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" +dependencies = [ + "cfg-if", + "libc", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" + +[[package]] +name = "fixed_decimal" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2214fb00f669ee96bee5bb29dfb1ddabe058b2bc426817efc79afa03c9bc55ae" +dependencies = [ + "displaydoc", + "smallvec", + "writeable", +] + +[[package]] +name = "fixedbitset" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5905ec755cc8386d7928353e4d356d2be3e89e81e5ca01fe630a1ca4d08dc175" + +[[package]] +name = "flate2" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4" +dependencies = [ + "crc32fast", + "miniz_oxide 0.9.1", + "zlib-rs", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "font-types" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835ae9d781464a79026cde387f9cbc650c9a4909d7cf7e658b127e3c35d2f35d" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "fontdb" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2660c5e9157bf76d2db1294e4a9feba604ef610819a3b591088d0d8392a3290f" +dependencies = [ + "log", + "slotmap", + "tinyvec", +] + +[[package]] +name = "fontique" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6688bc1294fe7117d788937b6c53480169b29c566954af490830d4c09da9516a" +dependencies = [ + "hashbrown 0.17.1", + "linebender_resource_handle", + "memmap2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-text", + "objc2-foundation 0.3.2", + "parlance", + "read-fonts", + "roxmltree", + "smallvec", + "windows", + "windows-core", + "yeslogic-fontconfig-sys", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gethostname" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" +dependencies = [ + "rustix 1.1.6", + "windows-link", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", +] + +[[package]] +name = "gif" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "global-hotkey" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96daa86bdc1413406daee362a835e52c430c2193e5a5c328d1e522be140d1764" +dependencies = [ + "crossbeam-channel", + "keyboard-types 0.8.3", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "once_cell", + "thiserror 2.0.21", + "windows-sys 0.59.0", + "x11rb", + "xkeysym", +] + +[[package]] +name = "glow" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "263218b0ba2b0715c3370fb04674f5f8aa331594b521c94ff0a8e4a8472d1386" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12124de845cacfebedff80e877bb37b5b75c34c5a4c89e47e1cdd67fb6041325" +dependencies = [ + "bitflags 2.13.2", + "cfg_aliases", + "cgl", + "dispatch2", + "glutin_egl_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "once_cell", + "raw-window-handle", + "wayland-sys", + "windows-sys 0.52.0", + "x11-dl", +] + +[[package]] +name = "glutin-winit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85edca7075f8fc728f28cb8fbb111a96c3b89e930574369e3e9c27eb75d3788f" +dependencies = [ + "cfg_aliases", + "glutin", + "raw-window-handle", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4680ba6195f424febdc3ba46e7a42a0e58743f2edb115297b86d7f8ecc02d2" +dependencies = [ + "gl_generator", + "windows-sys 0.52.0", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7bb2938045a88b612499fbcba375a77198e01306f52272e692f8c1f3751185" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gpu-allocator" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795" +dependencies = [ + "ash", + "hashbrown 0.16.1", + "log", + "presser", + "thiserror 2.0.21", + "windows", +] + +[[package]] +name = "grid" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b40ca9252762c466af32d0b1002e91e4e1bc5398f77455e55474deb466355ff5" + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "num-traits", + "zerocopy", +] + +[[package]] +name = "harfrust" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03d949a14aa089bbb282f7dd76a498a7f684428e4257202efc119ec010376f9" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "read-fonts", + "smallvec", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash 0.2.0", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "htmlparser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48ce8546b993eaf241d69ded33b1be6d205dd9857ec879d9d18bd05d3676e144" + +[[package]] +name = "hushkey" +version = "1.0.0" +dependencies = [ + "auto-launch", + "directories", + "env_logger", + "global-hotkey", + "libc", + "libpulse-binding", + "log", + "objc2 0.6.5", + "objc2-foundation 0.3.2", + "serde", + "slint", + "slint-build", + "toml", + "tray-icon", + "windows", +] + +[[package]] +name = "i-slint-backend-linuxkms" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f519a8611a4982921e46e391015e5e40ceac5cc63813333ef91ada77df180d8" +dependencies = [ + "bytemuck", + "calloop 0.14.5", + "cfg_aliases", + "drm", + "i-slint-common", + "i-slint-core", + "i-slint-renderer-software", + "input", + "libseat", + "memmap2", + "nix", + "xkbcommon", +] + +[[package]] +name = "i-slint-backend-selector" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb974705d61ba56034f6129ff61f3e6282a2c0c07752f25e6cb417d81c0f0958" +dependencies = [ + "cfg-if", + "cfg_aliases", + "i-slint-backend-linuxkms", + "i-slint-backend-testing", + "i-slint-backend-winit", + "i-slint-common", + "i-slint-core", + "i-slint-core-macros", +] + +[[package]] +name = "i-slint-backend-testing" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01943d6c5ea5bc913d497bdaa423c309e7627afff47a6794bfd13be5c564209f" +dependencies = [ + "cfg_aliases", + "i-slint-common", + "i-slint-core", + "i-slint-renderer-software", + "vtable", +] + +[[package]] +name = "i-slint-backend-winit" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae4fcf1b19e9cb109984d2af87d2b9485388c619265bff71dd523133888bee2" +dependencies = [ + "accesskit", + "accesskit_winit", + "arboard", + "block2 0.6.2", + "bytemuck", + "cfg-if", + "cfg_aliases", + "futures", + "glutin", + "glutin-winit", + "i-slint-common", + "i-slint-core", + "i-slint-core-macros", + "i-slint-renderer-skia", + "i-slint-renderer-software", + "imgref", + "lyon_path", + "muda 0.19.3", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", + "objc2-ui-kit 0.3.2", + "pin-weak", + "raw-window-handle", + "rgb", + "scoped-tls-hkt", + "scopeguard", + "softbuffer", + "strum", + "vtable", + "wasm-bindgen", + "web-sys", + "webbrowser", + "windows", + "winit", + "zbus", +] + +[[package]] +name = "i-slint-common" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a578f3e4b681b2b9cbd326d3be19716e2fac51d00a8a5b00c0ef4ae923b5e6" +dependencies = [ + "derive_more", + "fontique", + "htmlparser", + "icu_decimal", + "icu_locale_core", + "icu_provider", + "pulldown-cmark", + "resvg", + "skrifa", +] + +[[package]] +name = "i-slint-compiler" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55d48ebef05e2bf09ba5a1fc67bcb11033b9e12a2a50ed3105c7d25e2b539d0" +dependencies = [ + "annotate-snippets", + "by_address", + "data-url", + "derive_more", + "i-slint-common", + "icu_normalizer", + "icu_properties", + "image", + "indexmap", + "itertools 0.15.0", + "lyon_extra", + "lyon_path", + "num_enum", + "proc-macro2", + "quote", + "rayon", + "resvg", + "rowan", + "rspolib", + "skrifa", + "smol_str 0.3.7", + "strum", + "swash", + "typed-index-collections", + "unicode-segmentation", + "url", +] + +[[package]] +name = "i-slint-core" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2ea15059d70bc31b1a8b1eb4c34f2c5df04cb7e53f36179b43c0261231d646" +dependencies = [ + "accesskit", + "bitflags 2.13.2", + "cfg-if", + "chrono", + "clru", + "const-field-offset", + "derive_more", + "euclid", + "i-slint-common", + "i-slint-core-macros", + "icu_normalizer", + "image", + "js-sys", + "lyon_algorithms", + "lyon_extra", + "lyon_geom", + "lyon_path", + "num-traits", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "once_cell", + "parley", + "pin-project", + "pin-weak", + "portable-atomic", + "raw-window-handle", + "resvg", + "rgb", + "scopeguard", + "skrifa", + "slab", + "strum", + "swash", + "sys-locale", + "taffy", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", + "vtable", + "wasm-bindgen", + "web-sys", + "web-time", + "wgpu", + "windows", +] + +[[package]] +name = "i-slint-core-macros" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f5a8a076de52f53be80caa826599ed2107b54c9d4a421e66dc06cf893a984c" +dependencies = [ + "quote", + "serde_json", + "syn 3.0.10", +] + +[[package]] +name = "i-slint-renderer-skia" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc9c1cf02385f1d26fc1f423544e52390a8e5c2d89420a8042aa94b4fe109d1f" +dependencies = [ + "bytemuck", + "cfg-if", + "cfg_aliases", + "clru", + "const-field-offset", + "glow", + "glutin", + "i-slint-common", + "i-slint-core", + "i-slint-core-macros", + "lyon_path", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", + "objc2-quartz-core 0.3.2", + "pin-weak", + "raw-window-handle", + "read-fonts", + "scoped-tls-hkt", + "skia-safe", + "softbuffer", + "spin_on", + "unicode-segmentation", + "vtable", + "wgpu", + "wgpu-hal", + "windows", + "windows-core", + "write-fonts", +] + +[[package]] +name = "i-slint-renderer-software" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f8c641e138a2cc96537cac4481f5c7c8bb8dcc66d09acaed269329c8738628a" +dependencies = [ + "bytemuck", + "clru", + "derive_more", + "euclid", + "i-slint-common", + "i-slint-core", + "lyon_path", + "num-traits", + "skrifa", + "swash", + "zeno", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_decimal" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1150ad5e272740670464934ee76facda43ef2e11f85c27b7ba76ccb33edf2d05" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_decimal_data", + "icu_locale_core", + "icu_locale_fallback", + "icu_plurals", + "icu_provider", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_decimal_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5595ab78370d48abd24a062f3db115d5108dd0b65634352036cae532aebb0df8" + +[[package]] +name = "icu_locale_core" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" +dependencies = [ + "displaydoc", + "litemap", + "serde", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locale_fallback" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "406e9ae5b95d8aa37db6293405931b766a6172d1848daee22d70eb44aa78a43c" +dependencies = [ + "icu_locale_core", + "icu_locale_fallback_data", + "icu_provider", + "potential_utf", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locale_fallback_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3632ebbd0c5c3637ba1a40bdf8288f2cb9d2268e73441a69d5fc73d7cfbaa87c" + +[[package]] +name = "icu_normalizer" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" + +[[package]] +name = "icu_plurals" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef046647b445acf95ce0f8083fa292467d3df649959fa9a20f3f8abfd957c5d" +dependencies = [ + "fixed_decimal", + "icu_locale_fallback", + "icu_plurals_data", + "icu_provider", + "zerovec", +] + +[[package]] +name = "icu_plurals_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43ff7df2c1a1d41588a6ddcba354d513d4a3e10eec22c06fe56d13c12a848ea" + +[[package]] +name = "icu_properties" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" + +[[package]] +name = "icu_provider" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" +dependencies = [ + "displaydoc", + "icu_locale_core", + "serde", + "stable_deref_trait", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_segmenter" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b195dc605f81aa181bec9b3bd14e26cc71b903e4644f6af578ca9772c7a710" +dependencies = [ + "icu_collections", + "icu_locale_fallback", + "icu_provider", + "icu_segmenter_data", + "potential_utf", + "smallvec", + "utf8_iter", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_segmenter_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "913a7d294ad056474749152107309fdee3ec17d2482d1ab70fdc61a81c64b9a3" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "image" +version = "0.25.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" +dependencies = [ + "bytemuck", + "byteorder-lite", + "moxcms", + "num-traits", + "png", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" +dependencies = [ + "byteorder-lite", + "quick-error", +] + +[[package]] +name = "imagesize" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b27460c2c92b037f3f94c538ed9a3342f3fdf923606781629ccb35f82d042a" + +[[package]] +name = "imgref" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f" + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "input" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9793345a65d71317763a33066b5d8351f8760dde8d4930fe9e39b5f14a7959d" +dependencies = [ + "bitflags 2.13.2", + "input-sys", + "libc", + "log", + "udev", +] + +[[package]] +name = "input-sys" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eee07d8e02bd95bf52b2e642cf13d33701b94c6e4b04fbf1d1fb07e9cb19e7" + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" + +[[package]] +name = "jiff" +version = "0.2.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26699905cc795a23e3949585cc7ba3ee8ade090872a27e4316304a777297894a" +dependencies = [ + "jiff-core", + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-core" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe6854081f5ac0a3046a9b223729ccd7a20b1e0e8277e44dc0660eedf67dfe2" +dependencies = [ + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b4ff49b2887190c760b86207b55cdcaabbdecaf7a0660d68aa2ed6f652abf0a" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys 0.4.1", + "log", + "simd_cesu8", + "thiserror 2.0.21", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.13.2", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "keyboard-types" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" +dependencies = [ + "bitflags 2.13.2", + "serde", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "ksni" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bcc1cb43797140f74b711f1c4a49f48a7a7429f211c5fb78264e7bcd1e99caf" +dependencies = [ + "arc-swap", + "async-executor", + "async-io", + "async-lock", + "crossbeam-queue", + "futures-channel", + "futures-lite", + "futures-util", + "pastey", + "serde", + "task-local", + "zbus", +] + +[[package]] +name = "kurbo" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b60dfc32f652b926df6192e55525b16d186c69d47876c3ead4da5cc9f8450e2" +dependencies = [ + "arrayvec", + "euclid", + "polycool", + "smallvec", +] + +[[package]] +name = "lazy_static" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libpulse-binding" +version = "2.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909eb3049e16e373680fe65afe6e2a722ace06b671250cc4849557bc57d6a397" +dependencies = [ + "bitflags 2.13.2", + "libc", + "libpulse-sys", + "num-derive", + "num-traits", + "winapi", +] + +[[package]] +name = "libpulse-sys" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d74371848b22e989f829cc1621d2ebd74960711557d8b45cfe740f60d0a05e61" +dependencies = [ + "libc", + "num-derive", + "num-traits", + "pkg-config", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d" +dependencies = [ + "bitflags 2.13.2", + "libc", + "plain", + "redox_syscall 0.9.5", +] + +[[package]] +name = "libseat" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6656c69b6e0366ffb83faa232f3e4fda5fc91161722d140f2c95ce2e90b1ef31" +dependencies = [ + "errno", + "libseat-sys", + "log", +] + +[[package]] +name = "libseat-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a484fa48be5f62a8d3ffed767779d0ab808cfead91de98ef4362d469097dfb" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "libudev-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "linebender_resource_handle" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "litrs" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" + +[[package]] +name = "lyon_algorithms" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a6b9d4e8b48acd531fbf1241ad9b270df6e60b6b92bdea1469f4f40899d805" +dependencies = [ + "lyon_path", + "num-traits", +] + +[[package]] +name = "lyon_extra" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7755f08423275157ad1680aaecc9ccb7e0cc633da3240fea2d1522935cc15c72" +dependencies = [ + "lyon_path", + "thiserror 2.0.21", +] + +[[package]] +name = "lyon_geom" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82dd26aa4dc0b5b70b9115de59824842bcb43cf4a28e1b1e6d0ad148c93f93e" +dependencies = [ + "arrayvec", + "euclid", + "num-traits", +] + +[[package]] +name = "lyon_path" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c463f9c428b7fc5ec885dcd39ce4aa61e29111d0e33483f6f98c74e89d8621e" +dependencies = [ + "lyon_geom", + "num-traits", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memmap2" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "moxcms" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" +dependencies = [ + "num-traits", + "pxfm", +] + +[[package]] +name = "muda" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd04e60bc0b07438a6771710ee1698f98f6ebbc7f89b61264af1563b8aeb878" +dependencies = [ + "crossbeam-channel", + "dpi", + "keyboard-types 0.7.0", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "once_cell", + "png", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "muda" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4340e89c178916e62879c5c36b7f699019369be413e496178a6983ce91b8bc03" +dependencies = [ + "crossbeam-channel", + "dpi", + "keyboard-types 0.8.3", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "png", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "naga" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd0dd362bf26c0ffdd143df6da66a25d287e196eff482f117771010b207ad163" +dependencies = [ + "arrayvec", + "bit-set", + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "codespan-reporting", + "half", + "hashbrown 0.17.1", + "indexmap", + "libm", + "log", + "naga-types", + "num-traits", + "once_cell", + "rustc-hash 1.1.0", + "spirv", + "thiserror 2.0.21", + "unicode-ident", +] + +[[package]] +name = "naga-types" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14474170feb673cfb18b3565111a9869797cc1d290fb9ec969c53f5e1e231c6d" +dependencies = [ + "hashbrown 0.17.1", + "indexmap", + "rustc-hash 1.1.0", + "thiserror 2.0.21", +] + +[[package]] +name = "natord" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308d96db8debc727c3fd9744aac51751243420e46edf401010908da7f8d5e57c" + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.13.2", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d5490aaf8f1d7cf7688dfa9b0ce07900e168852c45cd2c03f534dfd27cfd0b" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +dependencies = [ + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "libc", + "objc2 0.5.3", + "objc2-core-data 0.2.2", + "objc2-core-image 0.2.2", + "objc2-foundation 0.2.2", + "objc2-quartz-core 0.2.2", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "objc2 0.5.3", + "objc2-core-location 0.2.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.3", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "objc2 0.5.3", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2 0.6.5", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.3", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", +] + +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.3", + "objc2-contacts", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-location" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "dispatch", + "libc", + "objc2 0.5.3", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.13.2", + "block2 0.6.2", + "libc", + "objc2 0.6.5", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.3", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "objc2 0.5.3", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-metal" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794" +dependencies = [ + "bitflags 2.13.2", + "block2 0.6.2", + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "objc2 0.5.3", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", +] + +[[package]] +name = "objc2-security" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-service-management" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b213642d6959cc6023ceb1217aa595eaaf09b8094ce95127c103cab611fe65e8" +dependencies = [ + "block2 0.6.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-security", +] + +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2 0.5.3", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "objc2 0.5.3", + "objc2-cloud-kit 0.2.2", + "objc2-core-data 0.2.2", + "objc2-core-image 0.2.2", + "objc2-core-location 0.2.2", + "objc2-foundation 0.2.2", + "objc2-link-presentation", + "objc2-quartz-core 0.2.2", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications 0.2.2", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.13.2", + "block2 0.6.2", + "objc2 0.6.5", + "objc2-cloud-kit 0.3.2", + "objc2-core-data 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image 0.3.2", + "objc2-core-location 0.3.2", + "objc2-core-text", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", + "objc2-user-notifications 0.3.2", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.3", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.13.2", + "block2 0.5.1", + "objc2 0.5.3", + "objc2-core-location 0.2.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +dependencies = [ + "critical-section", + "portable-atomic", +] + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "orbclient" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5df339f526ea9a60e371768d50efc2f2508c7203290731565d1f7a6f71d21747" +dependencies = [ + "libc", + "libredox", +] + +[[package]] +name = "ordered-float" +version = "5.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f59006ce1e204c30956638535b74d317bca99477b9356dfaec54c37f6f600ab" +dependencies = [ + "num-traits", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "os_info" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf20a545b305cf1da722b236b5155c9bb35f1d5ceb28c048bd96ca842f41b5b" +dependencies = [ + "android_system_properties", + "log", + "nix", + "objc2 0.6.5", + "objc2-foundation 0.3.2", + "objc2-ui-kit 0.3.2", + "windows-sys 0.61.2", +] + +[[package]] +name = "os_pipe" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link", +] + +[[package]] +name = "parlance" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73072a9470554c8e794778acece2312661218aaabb635600957d952cf01c716e" + +[[package]] +name = "parley" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22d2ff88bd3f7d68d1d9b09c7e6209f9a8e8c05088295140a2bcf2e9b17038c5" +dependencies = [ + "accesskit", + "fontique", + "harfrust", + "hashbrown 0.17.1", + "icu_normalizer", + "icu_properties", + "icu_segmenter", + "linebender_resource_handle", + "parlance", + "parley_data", + "skrifa", +] + +[[package]] +name = "parley_data" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1567535334d6ba2d3cde19221ba9a7bd0fabb3cbd99046ddfb10ae061cfcc889" +dependencies = [ + "icu_properties", +] + +[[package]] +name = "pastey" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset", + "hashbrown 0.15.5", + "indexmap", +] + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pin-utils" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13bee6c73da26345c729282832b60b0363cf3dd9f4bfd81d8551b7a1c889a113" + +[[package]] +name = "pin-weak" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b330c9d1b92dfe68442ca20b009c717d5f0b1e3cf4965e62f704c3c6e95a1305" + +[[package]] +name = "piper" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "png" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" +dependencies = [ + "bitflags 2.13.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.5.3", + "pin-project-lite", + "rustix 1.1.6", + "windows-sys 0.61.2", +] + +[[package]] +name = "polycool" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50596ddc09eb5ad5f75cacd40209568e66df71baf86e1499a0e99c4cff12a5a6" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" +dependencies = [ + "critical-section", +] + +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "serde_core", + "writeable", + "zerovec", +] + +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.119", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" + +[[package]] +name = "pulldown-cmark" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db2be46835f013dd3f4fa7f5f7402c537787b54ebb6fe2b94bbdd7e2669bb7b" +dependencies = [ + "bitflags 2.13.2", + "memchr", + "unicase", +] + +[[package]] +name = "pxfm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quick-xml" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "range-alloc" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08" + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "raw-window-metal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135" +dependencies = [ + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "read-fonts" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709" +dependencies = [ + "bytemuck", + "font-types", + "once_cell", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "redox_syscall" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "580c875845b41ecb1564ad1ae4703044cef774145e3d7a94dc2b3fa7c97868fd" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "redox_users" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" +dependencies = [ + "libredox", + "thiserror 2.0.21", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "resvg" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e3803f97b999e80cbf7c6ecdd07a8102204d92e1633cf48783720c521196bd" +dependencies = [ + "bytemuck", + "gif", + "image-webp", + "log", + "pico-args", + "rgb", + "svgtypes", + "tiny-skia 0.12.0", + "usvg", + "zune-jpeg", +] + +[[package]] +name = "rgb" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "rowan" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b574c58582fa59fa43a2feb6608b8744184659f08a2e0117e4b8224d95ed61" +dependencies = [ + "countme", + "hashbrown 0.14.5", + "memoffset", + "rustc-hash 1.1.0", + "text-size", +] + +[[package]] +name = "roxmltree" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9da7f59328b09405b181fee1018925fad50f157afb43c0c0f5c522c256dd5907" +dependencies = [ + "memchr", +] + +[[package]] +name = "rspolib" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fda9a7796aff63a7b1b39ccc93fffaaf65e20042984b4843041a49ca4677535" +dependencies = [ + "lazy_static", + "natord", + "snafu", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.13.2", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" +dependencies = [ + "bitflags 2.13.2", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scoped-tls-hkt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9603871ffe5df3ac39cb624790c296dbd47a400d202f56bf3e414045099524d" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sctk-adwaita" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia 0.11.4", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "serde_spanned" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c187e0a369471c550af028cba56d4f4fa2a489ad28151ae95a4d340a2a8b782" +dependencies = [ + "serde_core", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "simplecss" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c" +dependencies = [ + "log", +] + +[[package]] +name = "siphasher" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" + +[[package]] +name = "skia-bindings" +version = "0.153.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb325787c91b3f6c34a7c6f2b8a2297b20292d733ca53a08c233e5028aec49af" +dependencies = [ + "bindgen", + "cc", + "flate2", + "heck", + "pkg-config", + "regex", + "serde_json", + "tar", + "toml", +] + +[[package]] +name = "skia-safe" +version = "0.153.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61cb643dac43067f3eb76c866635a74377ac0abca0ff2590674e1e295514c3d" +dependencies = [ + "bitflags 2.13.2", + "skia-bindings", + "windows", +] + +[[package]] +name = "skrifa" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819ab7d62b1d3e72d9d9dea5650bac30424f9111364bb94928dbf5ecad1baa68" +dependencies = [ + "bytemuck", + "read-fonts", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "slint" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e477d5ff6fec20909100ff8f7062432ebfbda7a62a0f37d0252aa126f38c83" +dependencies = [ + "const-field-offset", + "i-slint-backend-linuxkms", + "i-slint-backend-selector", + "i-slint-backend-winit", + "i-slint-common", + "i-slint-core", + "i-slint-core-macros", + "i-slint-renderer-software", + "num-traits", + "once_cell", + "pin-weak", + "slint-macros", + "unicode-segmentation", + "vtable", +] + +[[package]] +name = "slint-build" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ea28d4e1ad47d829b91e227f17037fac07a8001668a93fee47ac04f88718ebc" +dependencies = [ + "derive_more", + "fontique", + "i-slint-compiler", + "spin_on", + "toml_edit", +] + +[[package]] +name = "slint-macros" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e74b13d20884dc480ce37d0fabbf02cb4bc0df2a595434feac96ca7c2a0f15" +dependencies = [ + "i-slint-compiler", + "proc-macro2", + "quote", + "spin_on", +] + +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.16.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "149309498a5f7334b12ddae0cad8aba81ce785fe91755068867e017cf98fee46" + +[[package]] +name = "smappservice-rs" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52703b97a53101cf5d4580e0737aaa634ce1fdcfc123c16b2a9658e358013488" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", + "objc2-service-management", + "thiserror 2.0.21", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +dependencies = [ + "bitflags 2.13.2", + "calloop 0.13.0", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2", + "rustix 0.38.44", + "thiserror 1.0.69", + "wayland-backend", + "wayland-client", + "wayland-csd-frame", + "wayland-cursor", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "xkeysym", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "smol_str" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeb7109d23f319619d4cc0de5464613c8b7b1a09db2774a58101459cf6be2f10" +dependencies = [ + "borsh", + "serde_core", +] + +[[package]] +name = "snafu" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" +dependencies = [ + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "as-raw-xcb-connection", + "bytemuck", + "fastrand", + "js-sys", + "memmap2", + "ndk", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", + "raw-window-handle", + "redox_syscall 0.5.18", + "rustix 1.1.6", + "tiny-xlib", + "tracing", + "wasm-bindgen", + "wayland-backend", + "wayland-client", + "wayland-sys", + "web-sys", + "windows-sys 0.61.2", + "x11rb", +] + +[[package]] +name = "spin_on" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076e103ed41b9864aa838287efe5f4e3a7a0362dd00671ae62a212e5e4612da2" +dependencies = [ + "pin-utils", +] + +[[package]] +name = "spirv" +version = "0.4.0+sdk-1.4.341.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9571ea910ebd84c86af4b3ed27f9dbdc6ad06f17c5f96146b2b671e2976744f" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] + +[[package]] +name = "strum" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "svgtypes" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f12b12995e3638c70618c1facb1ce65302f6a6f706b675f07c58a5d7391120e" +dependencies = [ + "kurbo", + "siphasher", +] + +[[package]] +name = "swash" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2499c2d826531388872b2268718aed907a39bd785ab0dcfe57fab26283f92e" +dependencies = [ + "skrifa", + "yazi", + "zeno", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "js-sys", + "libc", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "taffy" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aea22054047c16c3f34d3ac473a2170be1424b1115b2a3adcf28cfb067c88859" +dependencies = [ + "arrayvec", + "grid", + "serde", + "slotmap", +] + +[[package]] +name = "tar" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "task-local" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2972044a9e5e448a506a7ff6f0d03b566d8ef4cd6918a58fc59835a0f8666626" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix 1.1.6", + "windows-sys 0.61.2", +] + +[[package]] +name = "text-size" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +dependencies = [ + "thiserror-impl 2.0.21", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path 0.11.4", +] + +[[package]] +name = "tiny-skia" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47ffee5eaaf5527f630fb0e356b90ebdec84d5d18d937c5e440350f88c5a91ea" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "png", + "tiny-skia-path 0.12.0", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tiny-skia-path" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca365c3faccca67d06593c5980fa6c57687de727a03131735bb85f01fdeeb9" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tiny-xlib" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90a0ca3ee6a69f2ad28fd11621a4c3f03b371f366be500b64df260c4ffbafb4" +dependencies = [ + "as-raw-xcb-connection", + "ctor", + "libloading", + "pkg-config", + "tracing", +] + +[[package]] +name = "tinystr" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" +dependencies = [ + "displaydoc", + "serde_core", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" + +[[package]] +name = "tokio" +version = "1.54.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "toml" +version = "1.2.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5755c51863cdac711f1956baf8eb9588e060755f7d3c4c979e70ea1e1f32cd7" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_datetime" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173f25c883cd2176a2d8212155638c0a60d484a9d84546d270866f40f56b6e49" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.19+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd43688c4858d7264ae1cf9a9f874a67c3feb74a883b1cd7bebd6a4ea8307218" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.2.0+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009dbb7700f11c55ef83aebbe4c0e9cf1f1ac0844bd8d6f00dc38f302026e13a" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tray-icon" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f5cc5858ecf9574ddd8f0032a2ff7ffd6f7724d2b81e48b9374984b3fd6ddc9" +dependencies = [ + "crossbeam-channel", + "ksni", + "muda 0.21.2", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation 0.3.2", + "once_cell", + "png", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "tree_magic_mini" +version = "3.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6" +dependencies = [ + "memchr", + "nom 8.0.0", + "petgraph", +] + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "typed-index-collections" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "898160f1dfd383b4e92e17f0512a7d62f3c51c44937b23b6ffc3a1614a8eaccd" +dependencies = [ + "bincode", + "serde", +] + +[[package]] +name = "udev" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4e37e9ea4401fc841ff54b9ddfc9be1079b1e89434c1a6a865dd68980f7e9f" +dependencies = [ + "io-lifetimes", + "libc", + "libudev-sys", + "pkg-config", +] + +[[package]] +name = "uds_windows" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" +dependencies = [ + "memoffset", + "tempfile", + "windows-sys 0.61.2", +] + +[[package]] +name = "unicase" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-script" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-vo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" + +[[package]] +name = "unicode-width" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "usvg" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "977d0a4abdef933f424a99fe09f95576e089b90aebc6f016a3bc813762493e91" +dependencies = [ + "base64", + "data-url", + "flate2", + "fontdb", + "harfrust", + "imagesize", + "kurbo", + "log", + "pico-args", + "roxmltree", + "simplecss", + "siphasher", + "skrifa", + "strict-num", + "svgtypes", + "tiny-skia-path 0.12.0", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "xmlwriter", +] + +[[package]] +name = "utf8_iter" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0" +dependencies = [ + "utf_types", +] + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "utf_types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" + +[[package]] +name = "uuid" +version = "1.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed99139f7dac9b5cfe5f17be4d66dc7079a34dee1d74bcc77217119240e267c" +dependencies = [ + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vtable" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515a4b5b1399cc46fb0dc4081436cb40a3852a2d3e94fd1fa50bb68a334896eb" +dependencies = [ + "const-field-offset", + "portable-atomic", + "stable_deref_trait", + "vtable-macro", +] + +[[package]] +name = "vtable-macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8191d73ececf73fc94e65809bf0e667525a0bcff9aeeb8d042a4173a508332a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" +dependencies = [ + "cfg-if", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14e0327cb5368ad60ccb22d04a9827a693c95a926d8d125e9fa39e0baec501" +dependencies = [ + "js-sys", + "tokio", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.10", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wayland-backend" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38a91b4eaddff87b1cd1074985e3713da4af2c49742d1b356b2c01670a67a078" +dependencies = [ + "cc", + "downcast-rs", + "rustix 1.1.6", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c36a0f861ad76d0901f2800b46321410d9f73f2ea88aac0650d86c32688073" +dependencies = [ + "bitflags 2.13.2", + "rustix 1.1.6", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.13.2", + "cursor-icon", + "wayland-backend", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d" +dependencies = [ + "rustix 1.1.6", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d0c813de3daa2ed6520af85a3bd49b0e722a3078506899aa9686fea58dc4b6" +dependencies = [ + "bitflags 2.13.2", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b6d8cf1eb2c1c31ed1f5643c88a6e53538129d4af80030c8cabd1f9fa884d91" +dependencies = [ + "bitflags 2.13.2", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb04e52f7836d7c7976c78ca0250d61e33873c34156a2a1fc9474828ec268234" +dependencies = [ + "bitflags 2.13.2", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "338e30461b3a2b67d70eb30a6d89f8e0c93a833e07d2ae89085cd070c4a00ac0" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73e91ccd4698f2647d6137e8eb17a3f1dcfd63810be9029fb2398f507279b95b" +dependencies = [ + "jni", + "log", + "ndk-context", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "url", + "web-sys", +] + +[[package]] +name = "weezl" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" + +[[package]] +name = "wgpu" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146fc3d654250e6207921a66c87534c621bc886c70df83dcf466c1d66813810e" +dependencies = [ + "arrayvec", + "bitflags 2.13.2", + "bytemuck", + "cfg-if", + "cfg_aliases", + "document-features", + "hashbrown 0.17.1", + "log", + "portable-atomic", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad661da2ee99f208c30090b585284b2ab5b8bf2358ddf2d2215592808ec62f1a" +dependencies = [ + "arrayvec", + "bit-set", + "bit-vec", + "bitflags 2.13.2", + "bytemuck", + "cfg_aliases", + "document-features", + "hashbrown 0.17.1", + "indexmap", + "log", + "naga", + "naga-types", + "once_cell", + "parking_lot", + "portable-atomic", + "profiling", + "raw-window-handle", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 2.0.21", + "wgpu-core-deps-apple", + "wgpu-core-deps-windows-linux-android", + "wgpu-hal", + "wgpu-naga-bridge", + "wgpu-types", +] + +[[package]] +name = "wgpu-core-deps-apple" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d3f2f24aee039ffe9ef527300daf6b7428c58edeefdaa1700f4fa0fd754df16" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-core-deps-windows-linux-android" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1331b08fa2362c5d454eccc4448e6e4f01eccfea569a00e310adbfc4415f2bdc" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-hal" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a57452fe453658e141aafdb09de1028afa498805fab518238ddf372a518813ff" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.13.2", + "block2 0.6.2", + "bytemuck", + "cfg-if", + "cfg_aliases", + "gpu-allocator", + "hashbrown 0.17.1", + "libc", + "libloading", + "log", + "naga", + "naga-types", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", + "objc2-quartz-core 0.3.2", + "once_cell", + "ordered-float", + "parking_lot", + "portable-atomic", + "portable-atomic-util", + "profiling", + "range-alloc", + "raw-window-handle", + "raw-window-metal", + "renderdoc-sys", + "smallvec", + "static_assertions", + "thiserror 2.0.21", + "wgpu-naga-bridge", + "wgpu-types", + "windows", + "windows-core", +] + +[[package]] +name = "wgpu-naga-bridge" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44a62ead68aad7cd40ac9e2cd2b8ec64f32dfbad2765f429b9fb74b8b735869f" +dependencies = [ + "naga", + "wgpu-types", +] + +[[package]] +name = "wgpu-types" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9f6ee0bd50f5ab79fb8c25e3f33afb27126f034af4ba5909c7a0967058659e6" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "log", + "naga-types", + "raw-window-handle", + "static_assertions", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winit" +version = "0.30.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6755fa58a9f8350bd1e472d4c3fcc25f824ec358933bba33306d0b63df5978d" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.13.2", + "block2 0.5.1", + "bytemuck", + "calloop 0.13.0", + "cfg_aliases", + "concurrent-queue", + "core-foundation", + "core-graphics", + "cursor-icon", + "dpi", + "js-sys", + "libc", + "memmap2", + "ndk", + "objc2 0.5.3", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", + "objc2-ui-kit 0.2.2", + "orbclient", + "percent-encoding", + "pin-project", + "raw-window-handle", + "redox_syscall 0.4.1", + "rustix 0.38.44", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str 0.2.2", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.52.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + +[[package]] +name = "winnow" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wl-clipboard-rs" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "959c7ac3b8afde864f7a7448ac16f29b2b83350b7eccbf77fb781c3999aa6848" +dependencies = [ + "libc", + "log", + "os_pipe", + "rustix 1.1.6", + "thiserror 2.0.21", + "tree_magic_mini", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", +] + +[[package]] +name = "write-fonts" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae90d1d9f6d1d36ef116b0b1e651a6d7c12ba925439d4d06ff9adc94662a3d8" +dependencies = [ + "font-types", + "indexmap", + "kurbo", + "log", + "read-fonts", +] + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading", + "once_cell", + "rustix 1.1.6", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" + +[[package]] +name = "xattr" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "963d6fab92d5504b971dc8bd90ca743c2575e590bc8071ea5bc571598667ae08" +dependencies = [ + "libc", + "rustix 1.1.6", +] + +[[package]] +name = "xcursor" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "163b33ed8786455e2fa5d72f554057ce3f3182425434f756cd39c99839d88e23" + +[[package]] +name = "xkbcommon" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a974f48060a14e95705c01f24ad9c3345022f4d97441b8a36beb7ed5c4a02d" +dependencies = [ + "libc", + "memmap2", + "xkeysym", +] + +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.13.2", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" + +[[package]] +name = "xml-rs" +version = "0.8.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7" + +[[package]] +name = "xmlwriter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + +[[package]] +name = "yazi" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac366ea532fa8ee6a992cec9dea525b1dc284e69702f36c2ab5fbebadc81ec86" + +[[package]] +name = "yeslogic-fontconfig-sys" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8b8abf912b9a29ff112e1671c97c33636903d13a69712037190e6805af4f76" +dependencies = [ + "dlib", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yoke" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", + "synstructure", +] + +[[package]] +name = "zbus" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "libc", + "ordered-stream", + "rustix 1.1.6", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus-lockstep" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6998de05217a084b7578728a9443d04ea4cd80f2a0839b8d78770b76ccd45863" +dependencies = [ + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus-lockstep-macros" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10da05367f3a7b7553c8cdf8fa91aee6b64afebe32b51c95177957efc47ca3a0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "zbus-lockstep", + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.10", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd" +dependencies = [ + "serde", + "winnow", + "zvariant", +] + +[[package]] +name = "zbus_xml" +version = "5.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1586c021a01ca0a9216dcd874e546382e156a5cbab5fab6cb5f10087e22682a" +dependencies = [ + "serde", + "winnow", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zcheapstr" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939f186d9ecebe044315a5cb6d6f78568bbc21152adc954d5a0c2f58bdbc9920" +dependencies = [ + "serde", +] + +[[package]] +name = "zeno" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" + +[[package]] +name = "zerocopy" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "zerovec" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" +dependencies = [ + "serde", + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zune-core" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b" + +[[package]] +name = "zune-jpeg" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" +dependencies = [ + "zune-core", +] + +[[package]] +name = "zvariant" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7" +dependencies = [ + "endi", + "enumflags2", + "serde", + "winnow", + "zcheapstr", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.10", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 3.0.10", + "winnow", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a703832 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,69 @@ +[package] +name = "hushkey" +version = "1.0.0" +edition = "2021" +rust-version = "1.82" +description = "Global hotkeys to instantly mute/unmute individual apps — or everything at once." +license = "MIT" +repository = "https://github.com/X4Lo/HushKey" +readme = "README.md" +keywords = ["audio", "mute", "hotkey", "tray", "volume"] +categories = ["multimedia::audio", "gui"] +build = "build.rs" + +[dependencies] +# UI: native Rust toolkit, software renderer (no GPU context, no webview). +slint = { version = "1.18", default-features = false, features = [ + "std", + "compat-1-2", + "backend-winit", + "renderer-software", + "accessibility", + "unstable-winit-030", +] } + +global-hotkey = "0.10" +tray-icon = { version = "0.26", default-features = false } +serde = { version = "1", features = ["derive"] } +toml = "1" +directories = "6" +auto-launch = "0.6" +log = "0.4" +env_logger = { version = "0.11", default-features = false, features = ["auto-color", "humantime"] } + +[target.'cfg(target_os = "windows")'.dependencies] +windows = { version = "0.62", features = [ + "Win32_Foundation", + "Win32_Media_Audio", + "Win32_System_Com", + "Win32_System_Com_StructuredStorage", + "Win32_System_Threading", + "Win32_Storage_FileSystem", + "Win32_UI_Shell", + "Win32_UI_WindowsAndMessaging", + "Win32_Graphics_Gdi", + "Win32_Graphics_Dwm", +] } + +[target.'cfg(target_os = "macos")'.dependencies] +objc2 = "0.6" +objc2-foundation = { version = "0.3", default-features = false, features = ["std", "NSArray", "NSValue", "NSString"] } +libc = "0.2" + +[target.'cfg(target_os = "linux")'.dependencies] +libpulse-binding = "2.30" +# Pure-Rust StatusNotifierItem tray over D-Bus: no GTK main loop needed. +tray-icon = { version = "0.26", default-features = false, features = ["ksni"] } + +[build-dependencies] +slint-build = "1.18" + +[profile.release] +opt-level = 3 +lto = "fat" +codegen-units = 1 +strip = true +panic = "abort" + +[profile.dev.package."*"] +opt-level = 1 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..631d4ce --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,35 @@ +MIT License + +Copyright (c) 2026 HushKey contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## Third-party notice: Slint + +HushKey's user interface is built with [Slint](https://slint.dev), which is +*not* MIT-licensed. Slint is available under GPL-3.0, the Slint Royalty-free +Desktop, Mobile, and Web Applications License 2.0, or a commercial license. +HushKey uses it under the **Royalty-free License**, whose main condition is +attribution: the About section of the app credits Slint, and redistributors of +HushKey binaries must keep that attribution. See +. + +The MIT license above covers HushKey's own source code. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ad72cc --- /dev/null +++ b/README.md @@ -0,0 +1,101 @@ +
+ +# HushKey + +**One keystroke to mute any app. One more to mute everything.** + +Bind global shortcuts to individual applications' audio and toggle them instantly — even while a fullscreen game has focus. A tiny native tray app for Windows, macOS and Linux. + +[![License: MIT](https://img.shields.io/badge/License-MIT-7b6bff.svg)](LICENSE.md) +![Platforms](https://img.shields.io/badge/platforms-Windows%20%7C%20macOS%20%7C%20Linux-5b49f2) +![Rust](https://img.shields.io/badge/rust-stable-orange) + + +HushKey main window + +
+ +--- + +## Features + +- **Per-app mute shortcuts.** Every app with an audio session (playing *or* idle) shows up; click **Set shortcut**, press a combo, done. The same shortcut toggles mute/unmute. +- **Mute All.** One shortcut silences every app. Press it again to restore *exactly* the previous state — apps you had muted yourself stay muted. An optional second shortcut can be set to restore only. Apps that start playing while Mute All is on are silenced too. +- **Works everywhere.** Shortcuts are system-wide and fire while HushKey is hidden in the tray and while games or fullscreen apps have focus. +- **Instant feedback.** A small, click-through on-screen confirmation (it never steals focus from your game), plus a tray-icon flash. +- **Light on resources.** Native Rust with a software-rendered UI — no browser engine. The window is destroyed when closed, so the tray-resident app holds only the tray icon, the hotkey listener and an idle audio thread. Idle CPU is zero: nothing polls while the window is hidden. +- **Safe muting.** Uses the OS mixer's own mute flag rather than setting volume to 0, so your volume levels are never lost — even if HushKey crashes. +- **Persistent.** Bindings and settings live in a small TOML file in your OS config directory. +- **Dark mode by default**, light mode toggle, launch-at-login, start-minimized. + +## Platform support + +| | Windows 10/11 | macOS 14.2+ | Linux | +|---|---|---|---| +| Detect apps with audio | ✅ WASAPI sessions | ✅ Core Audio process objects | ✅ PulseAudio / PipeWire sink inputs | +| Per-app mute | ✅ | ✅ via process taps | ✅ | +| Per-app volume level | ✅ | ❌ no public API ([why](docs/design-decisions.md#macos-per-app-audio)) | ✅ | +| Global shortcuts | ✅ | ✅ | ✅ X11 · ⚠️ Wayland ([details](docs/design-decisions.md#wayland-global-shortcuts)) | +| Tray icon | ✅ | ✅ menu bar | ✅ StatusNotifierItem | +| Status | Tested on hardware | Compile-checked, needs testers | Compile-checked, needs testers | + +## Install + +Pre-built binaries will be published on the [Releases](https://github.com/X4Lo/HushKey/releases) page. Until then, build from source. + +### Build from source + +You need the stable [Rust toolchain](https://rustup.rs). Full per-platform notes are in [docs/building.md](docs/building.md). + +**Windows** + +```bash +cargo build --release +``` + +The binary is `target\release\hushkey.exe`. No runtime dependencies. + +**macOS** + +```bash +cargo build --release +``` + +Per-app muting needs macOS 14.2+ and the *Screen & System Audio Recording* permission. To get the permission prompt, run HushKey from an app bundle that has `NSAudioCaptureUsageDescription` set. See [docs/building.md](docs/building.md#macos). + +**Linux** (Debian/Ubuntu shown) + +```bash +sudo apt install build-essential pkg-config libpulse-dev libfontconfig1-dev libxkbcommon-dev +``` + +```bash +cargo build --release +``` + +Needs a PulseAudio server, or PipeWire with `pipewire-pulse` (the default on modern distros). On GNOME, the tray icon needs the *AppIndicator and KStatusNotifierItem Support* extension. + +## Usage + +1. Launch HushKey. It sits in the tray; click the icon to open the window. +2. Click **Set shortcut** next to an app and press a combination such as `Ctrl + Alt + S`. Letters and digits need Ctrl, Alt or Win/Cmd so normal typing isn't hijacked; F-keys can be used alone. + - `Esc` cancels, `Backspace` removes the shortcut. +3. Set a **Mute everything** shortcut in the card at the top. +4. Close the window — HushKey keeps running in the tray. Quit from the tray menu. + +Command line: `hushkey --minimized` starts in the tray; `hushkey --list` prints the detected audio apps (useful for bug reports). + +## Documentation + +- [Architecture](docs/architecture.md) — the `AudioController` trait, threads, and per-OS backends +- [Building](docs/building.md) — per-platform setup, packaging, permissions +- [Design decisions](docs/design-decisions.md) — why Slint, platform limitations and workarounds +- [Contributing](CONTRIBUTING.md) + +## License + +[MIT](LICENSE.md). The UI is built with [Slint](https://slint.dev), used under its Royalty-free Desktop license (attribution is shown in the app's About section). + +--- + +HushKey was created using Claude Opus 5.5. diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..89e1d8d --- /dev/null +++ b/build.rs @@ -0,0 +1,130 @@ +// The same rasteriser the app uses at runtime, so exe / taskbar / tray icons always match. +#[allow(dead_code)] +#[path = "src/ui/icon.rs"] +mod icon; + +use std::path::Path; + +fn main() { + // Same widget style on every OS so the app looks identical everywhere. + let config = slint_build::CompilerConfiguration::new().with_style("fluent".into()); + slint_build::compile_with_config("ui/main.slint", config).expect("Slint UI failed to compile"); + + println!("cargo:rerun-if-changed=src/ui/icon.rs"); + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default(); + let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default(); + if target_os == "windows" { + let out = std::env::var("OUT_DIR").unwrap(); + let images = icon_images(); + std::fs::write(Path::new(&out).join("hushkey.ico"), ico_file(&images)).unwrap(); + if target_env == "msvc" { + // link.exe accepts compiled resource files directly: no rc.exe / Windows SDK needed. + let res = Path::new(&out).join("hushkey.res"); + std::fs::write(&res, res_file(&images)).unwrap(); + println!("cargo:rustc-link-arg-bins={}", res.display()); + } + } +} + +const SIZES: [u32; 7] = [16, 20, 24, 32, 48, 64, 256]; + +/// Each size as an ICO-style DIB: BITMAPINFOHEADER + bottom-up BGRA + 1-bit AND mask. +fn icon_images() -> Vec<(u32, Vec)> { + SIZES + .iter() + .map(|&size| { + let rgba = icon::render(size, icon::IconState::Normal); + let mut dib = Vec::new(); + for v in [40u32, size, size * 2] { + dib.extend_from_slice(&v.to_le_bytes()); // biSize, biWidth, biHeight (xor+and) + } + dib.extend_from_slice(&1u16.to_le_bytes()); // planes + dib.extend_from_slice(&32u16.to_le_bytes()); // bit count + dib.extend_from_slice(&[0u8; 24]); // compression .. clrImportant + for y in (0..size).rev() { + for x in 0..size { + let i = ((y * size + x) * 4) as usize; + dib.extend_from_slice(&[rgba[i + 2], rgba[i + 1], rgba[i], rgba[i + 3]]); + } + } + let mask_row = size.div_ceil(32) * 4; // rows padded to 32 bits; all zero = use alpha + dib.extend(std::iter::repeat_n(0u8, (mask_row * size) as usize)); + (size, dib) + }) + .collect() +} + +fn dim(size: u32) -> u8 { + if size >= 256 { + 0 + } else { + size as u8 + } +} + +fn ico_file(images: &[(u32, Vec)]) -> Vec { + let mut f = Vec::new(); + f.extend_from_slice(&[0, 0, 1, 0]); + f.extend_from_slice(&(images.len() as u16).to_le_bytes()); + let mut offset = 6 + 16 * images.len() as u32; + for (size, dib) in images { + f.extend_from_slice(&[dim(*size), dim(*size), 0, 0]); + f.extend_from_slice(&1u16.to_le_bytes()); + f.extend_from_slice(&32u16.to_le_bytes()); + f.extend_from_slice(&(dib.len() as u32).to_le_bytes()); + f.extend_from_slice(&offset.to_le_bytes()); + offset += dib.len() as u32; + } + for (_, dib) in images { + f.extend_from_slice(dib); + } + f +} + +/// A compiled Win32 resource file (.res) with RT_ICON entries and RT_GROUP_ICON #1 +/// (the lowest-numbered group icon is what Explorer shows for the exe). +fn res_file(images: &[(u32, Vec)]) -> Vec { + const RT_ICON: u16 = 3; + const RT_GROUP_ICON: u16 = 14; + const LANG_EN_US: u16 = 0x0409; + let mut f = Vec::new(); + res_entry(&mut f, 0, 0, 0, &[], true); // mandatory empty first entry + for (i, (_, dib)) in images.iter().enumerate() { + res_entry(&mut f, RT_ICON, i as u16 + 1, LANG_EN_US, dib, false); + } + let mut group = Vec::new(); + group.extend_from_slice(&[0, 0, 1, 0]); + group.extend_from_slice(&(images.len() as u16).to_le_bytes()); + for (i, (size, dib)) in images.iter().enumerate() { + group.extend_from_slice(&[dim(*size), dim(*size), 0, 0]); + group.extend_from_slice(&1u16.to_le_bytes()); + group.extend_from_slice(&32u16.to_le_bytes()); + group.extend_from_slice(&(dib.len() as u32).to_le_bytes()); + group.extend_from_slice(&(i as u16 + 1).to_le_bytes()); + } + res_entry(&mut f, RT_GROUP_ICON, 1, LANG_EN_US, &group, false); + f +} + +fn res_entry(f: &mut Vec, kind: u16, id: u16, lang: u16, data: &[u8], empty: bool) { + f.extend_from_slice(&(data.len() as u32).to_le_bytes()); // DataSize + f.extend_from_slice(&32u32.to_le_bytes()); // HeaderSize + if empty { + f.extend_from_slice(&[0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0, 0]); + } else { + f.extend_from_slice(&0xFFFFu16.to_le_bytes()); + f.extend_from_slice(&kind.to_le_bytes()); + f.extend_from_slice(&0xFFFFu16.to_le_bytes()); + f.extend_from_slice(&id.to_le_bytes()); + } + f.extend_from_slice(&0u32.to_le_bytes()); // DataVersion + let flags: u16 = if empty { 0 } else { 0x1010 }; // MOVEABLE | DISCARDABLE + f.extend_from_slice(&flags.to_le_bytes()); + f.extend_from_slice(&lang.to_le_bytes()); + f.extend_from_slice(&0u32.to_le_bytes()); // Version + f.extend_from_slice(&0u32.to_le_bytes()); // Characteristics + f.extend_from_slice(data); + while f.len() % 4 != 0 { + f.push(0); + } +} diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..fc67447 --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,100 @@ +# Architecture + +HushKey is a single Rust binary with four layers. Only `src/audio/{windows,macos,linux}.rs` contain OS-specific audio code, and everything above the `AudioController` trait is platform-agnostic. + +``` +┌──────────────────────────────── main thread (Slint event loop) ─────────────────────────────┐ +│ app.rs ── state, config, UI wiring ──┬── ui/ (Slint window, toast, tray, icon) │ +│ ├── config/ (TOML load/save) │ +│ └── hotkeys/ (register / suspend / capture parsing) │ +└───────────────▲───────────────────────────────────┬─────────────────────────────────────────┘ + │ AudioEvent (invoke_from_event_loop)│ AudioCommand (mpsc) +┌───────────────┴──────────── audio thread ─────────▼─────────────────────────────────────────┐ +│ audio/worker.rs → MuteManager (toggle / mute-all state) → Box │ +│ ├─ windows.rs WASAPI sessions │ +│ ├─ macos.rs process taps │ +│ └─ linux.rs PulseAudio │ +└──────────────────────────────────────────────────────────────────────────────────────────────┘ + ▲ + │ AudioCommand sent directly from the OS hotkey callback (no UI hop) + global-hotkey handler +``` + +## Source layout + +| Path | Responsibility | +|---|---| +| `src/main.rs` | CLI flags, single-instance guard, Slint backend selection, event loop | +| `src/app.rs` | Main-thread controller: owns config, hotkeys, tray, toast, window; reacts to `AudioEvent`s | +| `src/audio/mod.rs` | `AudioController` trait, `AudioApp`, `AppKey`, errors, `create_controller()` | +| `src/audio/mute.rs` | `MuteManager`: toggle and Mute All / Restore All semantics (unit-tested) | +| `src/audio/worker.rs` | Audio thread, command/event enums | +| `src/audio/windows.rs` | Windows backend (Core Audio / WASAPI) | +| `src/audio/macos.rs` | macOS backend (Core Audio process taps) | +| `src/audio/linux.rs` | Linux backend (libpulse, works with PipeWire) | +| `src/audio/null.rs` | In-memory backend for tests and unsupported OSes | +| `src/hotkeys/accelerator.rs` | `Accelerator` type, string format, Slint key-event → shortcut (unit-tested) | +| `src/hotkeys/mod.rs` | `Hotkeys`: registers config bindings with the OS, dispatches presses | +| `src/config/mod.rs` | `Config`, `ConfigStore` (atomic TOML writes, corrupt-file recovery) | +| `src/ui/` | Tray (`tray.rs`), toast popup (`toast.rs`), procedural icon (`icon.rs`) | +| `src/platform.rs` | Launch-at-login, open folder, single-instance socket | +| `ui/*.slint` | Declarative UI, compiled into Rust by `build.rs` | + +## The `AudioController` trait + +```rust +pub trait AudioController { + fn backend_name(&self) -> &'static str; + fn capabilities(&self) -> Capabilities; // per_app_volume / per_app_mute + fn list_audio_apps(&mut self) -> AudioResult>; + fn set_app_volume(&mut self, app: &str, volume: f32) -> AudioResult<()>; + fn set_app_mute(&mut self, app: &str, muted: bool) -> AudioResult<()>; + fn mute_all(&mut self) -> AudioResult; // default impl + fn restore_all(&mut self, snapshot: &MuteSnapshot) -> AudioResult<()>; // default impl + fn app_icon(&mut self, app: &AudioApp) -> Option { None } + fn platform_note(&self) -> Option<&'static str> { None } +} +``` + +Key design points: + +- **Apps are identified by a stable `AppKey`, not by PID.** Bindings must survive restarts, so the key is the executable name on Windows (`spotify.exe`), the process binary on Linux (`firefox`), and the outermost `.app` bundle on macOS (`google chrome.app`). Every session or stream that shares a key is controlled together, so "mute Chrome" mutes every tab and helper process. +- **Mute uses the mixer's mute flag, not volume 0.** The OS keeps the user's level. Nothing is lost if HushKey crashes while an app is muted. On macOS the taps die with the process, so muted apps come back automatically. +- **`mute_all` returns a snapshot** of what *it* muted. `restore_all` only unmutes those apps, so apps the user had already muted stay muted. `MuteManager` keeps that snapshot and adjusts it when the user toggles an app by hand during Mute All. +- **Backends are not `Send`.** They are built *on* the audio thread by `create_controller()`. That allows thread-affine handles: COM objects in the MTA, the PulseAudio mainloop, Core Audio tap IDs. + +## Threads + +| Thread | What runs there | Idle cost | +|---|---|---| +| main | Slint event loop, tray, hotkey registration, toast | blocked in the OS message loop | +| `hushkey-audio` | backend + `MuteManager` | blocked on its channel (polls every 2 s only while Mute All is engaged, to catch late-starting apps) | +| `hushkey-instance` | accepts "show window" pings from second launches | blocked in `accept()` (64 KB stack) | +| OS / library threads | X11 hotkey thread (Linux), D-Bus tray (Linux), winit helpers | idle | + +### Hotkey press path + +1. The OS delivers the hotkey: `WM_HOTKEY` on Windows, a Carbon event on macOS, an X11 grab on Linux. +2. The `global-hotkey` callback looks up the hotkey ID and sends `AudioCommand::ToggleApp { key, from_hotkey: true }` straight to the audio thread. +3. The audio thread toggles the app (about 5–20 ms on Windows) and emits `AudioEvent::Toggled`. +4. The main thread shows the toast and flashes the tray icon. + +The UI thread is not on the critical path, so a busy UI can't delay muting. + +### Recording a shortcut + +While a chip is in "Press keys…" mode, `Hotkeys::suspend()` unregisters every global hotkey. Otherwise the OS would swallow a combo that's already bound and the window would never see it. The key event goes through `capture_from_key_event`, which maps Slint key text to physical key codes and enforces the "letters need a modifier" rule. Hotkeys are re-registered when the capture ends. + +## Memory strategy + +- **Software renderer** (`renderer-software`) draws into a CPU buffer, with no GPU context or driver allocations. +- **The window is destroyed on close**, not just hidden (`App::release_window`). The rows model, icons and settings live in `App`, so reopening the window rebuilds the UI instantly. +- The toast window is created on demand and dropped after it fades out. +- App icons are extracted once per app (64×64 RGBA, about 16 KB each) and cached. + +## Adding a backend + +1. Create `src/audio/.rs` implementing `AudioController`. Document limitations in its module comment and in `platform_note()`. +2. Add a `cfg` arm to `create_controller()` in `src/audio/mod.rs`. +3. Add platform dependencies under `[target.'cfg(...)'.dependencies]` in `Cargo.toml`. +4. Update the capability table in `README.md` and `docs/design-decisions.md`. diff --git a/docs/assets/main-window.webp b/docs/assets/main-window.webp new file mode 100644 index 0000000..82c9642 Binary files /dev/null and b/docs/assets/main-window.webp differ diff --git a/docs/building.md b/docs/building.md new file mode 100644 index 0000000..389b2e1 --- /dev/null +++ b/docs/building.md @@ -0,0 +1,95 @@ +# Building HushKey + +All platforms use the stable Rust toolchain (MSRV 1.82, check `rust-version` in `Cargo.toml`). Install it with [rustup](https://rustup.rs). + +```bash +cargo build # debug build, console logs visible +cargo build --release # optimized: fat LTO, stripped, panic=abort +cargo test # unit tests (config, accelerators, mute logic, icon) +``` + +Logging uses `env_logger`. Set `RUST_LOG=hushkey=debug` for more detail. Release builds on Windows have no console, so redirect output to a file if you need logs: `hushkey.exe > log.txt 2>&1`. + +Diagnostics: `hushkey --list` prints every detected audio app with its key, volume and mute state. + +--- + +## Windows + +**Requirements:** Windows 10 1809+ or Windows 11, plus the MSVC toolchain (Visual Studio Build Tools with the "Desktop development with C++" workload). + +```powershell +cargo build --release +.\target\release\hushkey.exe +``` + +- No runtime dependencies and no installer needed. The exe is self-contained. +- Config: `%APPDATA%\HushKey\config\config.toml` +- Launch at login writes `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\HushKey`. +- **Gotcha:** if a game runs elevated (as administrator) and HushKey does not, hotkeys still fire, but some anti-cheat systems block other processes' audio sessions from being changed. Running HushKey elevated is a workaround, not a requirement. + +## macOS + +**Requirements:** macOS 14.2+ for per-app muting (older versions list apps read-only), plus the Xcode Command Line Tools (`xcode-select --install`). + +```bash +cargo build --release +``` + +### Permissions and bundling + +Per-app muting uses Core Audio process taps, which are gated by the **Screen & System Audio Recording** permission. macOS only shows the permission prompt for an **app bundle** whose `Info.plist` contains a usage string: + +```xml +NSAudioCaptureUsageDescription +HushKey mutes individual apps by attaching a muted audio tap to them. No audio is recorded. +LSUIElement + +``` + +`LSUIElement` hides the Dock icon (HushKey also sets the accessory activation policy at runtime). One way to bundle is [`cargo-bundle`](https://github.com/burtonageo/cargo-bundle). Add the keys above to the generated plist. + +If muting fails with a permission message, open **System Settings → Privacy & Security → Screen & System Audio Recording** and enable HushKey. Global hotkeys use the Carbon API and need **no** Accessibility permission. + +- Config: `~/Library/Application Support/HushKey/config.toml` +- Launch at login installs a LaunchAgent in `~/Library/LaunchAgents/`. + +## Linux + +**Requirements:** a PulseAudio server, or PipeWire with `pipewire-pulse` (the default on Fedora 34+, Ubuntu 22.10+, Debian 12+ and Arch). An X11 session is needed for global hotkeys; see Wayland below. + +Build dependencies: + +| Distro | Command | +|---|---| +| Debian / Ubuntu | `sudo apt install build-essential pkg-config libpulse-dev libfontconfig1-dev libxkbcommon-dev` | +| Fedora | `sudo dnf install gcc pkgconf-pkg-config pulseaudio-libs-devel fontconfig-devel libxkbcommon-devel` | +| Arch | `sudo pacman -S base-devel pkgconf libpulse fontconfig libxkbcommon` | + +```bash +cargo build --release +``` + +- Tray: StatusNotifierItem over D-Bus. KDE, XFCE, Cinnamon and others support it out of the box. On GNOME, install the *AppIndicator and KStatusNotifierItem Support* extension. Without a tray, HushKey keeps its window open so it stays reachable. +- Config: `$XDG_CONFIG_HOME/hushkey/config.toml` (usually `~/.config/hushkey/`) +- Launch at login writes `~/.config/autostart/HushKey.desktop`. + +### Wayland + +Wayland has no protocol that lets an app grab global shortcuts. Under a Wayland session HushKey's hotkeys only fire while an XWayland window has focus. Workarounds: + +1. Log into an X11 session, **or** +2. Bind the shortcut in your desktop's own keyboard settings to a command. This is a known gap: HushKey has no CLI toggle command yet. Contributions welcome (see [CONTRIBUTING.md](../CONTRIBUTING.md)). + +--- + +## Cross-checking other platforms + +From any OS you can type-check the macOS backend without a Mac: + +```bash +rustup target add aarch64-apple-darwin +cargo check --target aarch64-apple-darwin +``` + +Cross-checking Linux from Windows/macOS fails inside native font dependencies (`fontconfig`/`pkg-config`). Use CI, a container, or WSL with the build dependencies above. diff --git a/docs/design-decisions.md b/docs/design-decisions.md new file mode 100644 index 0000000..2948b4a --- /dev/null +++ b/docs/design-decisions.md @@ -0,0 +1,82 @@ +# Design decisions + +## UI toolkit: Slint, not Tauri / egui / iced + +HushKey is a utility that runs all day in the tray. Idle footprint and responsiveness matter more than anything else. + +| Option | Why not / why | +|---|---| +| **Tauri** | Ships a system WebView (WebView2 / WebKitGTK). Even an idle window costs tens of MB of RAM across several helper processes. Rejected: too heavy for an always-on tray utility. | +| **egui** | Immediate mode: redraws the whole UI each frame while interacting, and usually runs on a GPU context (wgpu/glow) with its driver allocations. Its default look is a "developer tool" aesthetic. | +| **iced** | Good architecture, but pulls in wgpu by default and is heavier to theme for this kind of polished card UI. | +| **Slint** ✅ | Declarative `.slint` markup compiled to native Rust at build time. Retained mode: only dirty regions repaint. Has a **software renderer**, so no GPU context or driver memory. Animations, rounded corners, shadows and gradients are built in, giving a modern look cheaply. Exposes winit hooks, which we need for the non-activating toast window. | + +Licensing: Slint is GPLv3 / Royalty-free / commercial. HushKey (MIT) uses it under the Royalty-free license, which requires attribution, shown in the app's About section. See [LICENSE.md](../LICENSE.md). + +Further memory choices: + +- The main window is **destroyed** on close and rebuilt on demand. All state lives in `App`. +- The toast is created per notification and dropped after it fades. +- Nothing polls while hidden. The audio thread blocks on its channel, except for a 2-second check while Mute All is engaged. + +## License: MIT + +MIT is the norm in the Rust ecosystem: most of our dependencies are MIT/Apache-2.0. It's short and lets anyone package or fork the app. Apache-2.0's patent grant matters little for a small desktop utility with no novel algorithms, so the simpler license wins. + +## Mute flag instead of "volume → 0" + +The original spec described muting as "set volume to 0, restore the previous volume". HushKey uses the OS mixer's **mute flag** instead, on every platform that has one: + +- The user's volume level is preserved by the OS itself, so there's no saved state to lose. +- If HushKey crashes or is killed while apps are muted, nothing is stuck at 0%. The user unmutes in the system mixer as usual. On macOS, taps are released automatically when the process exits. +- The OS mixer UI shows the app as muted, which matches what the user sees in HushKey. + +`set_app_volume` is still implemented on Windows and Linux as part of the backend contract. + +## Stable app identity + +Bindings are keyed by executable name / bundle, never by PID, so they survive app and HushKey restarts. All sessions or streams of one app are controlled together. Bound apps that aren't running stay listed (greyed out) so their shortcut can still be edited. + +## Shortcut rules + +- Shortcuts use **physical key codes** (what the OS hotkey APIs register). On non-US layouts, the stored key is the US-layout position. +- Letters, digits, punctuation, Space, Enter and arrows **require Ctrl, Alt or Win/Cmd**, so a binding can't hijack normal typing. Shift alone doesn't count. F1–F24, Pause, Scroll Lock and Insert may be used alone. +- While recording a shortcut, all global hotkeys are temporarily unregistered so the combo reaches the window. +- Conflicts with another HushKey binding are rejected up front. Conflicts with other programs are reported when registration fails. + +## Feedback without stealing focus + +The toast window is created with winit `active = false`, no decorations, always-on-top, skip-taskbar (Windows) and cursor hit-testing disabled. Taking focus would minimize exclusive-fullscreen games and interrupt typing. Games in true exclusive fullscreen draw over every window, so the toast can't show there. The tray icon still flashes and the result is still applied. Most modern games use borderless fullscreen, where the toast is visible. + +--- + +## Platform limitations + +### macOS per-app audio + +macOS has **no public API to change another process's volume**. The CoreAudio HAL exposes device volume only. The established approaches: + +1. **Virtual audio driver** (SoundSource, Background Music, eqMac): route all audio through a HAL plug-in that mixes per-app. This needs an installer, admin rights and a system extension. It's invasive, fragile across macOS updates, and far beyond a hotkey utility. +2. **Core Audio process taps** (`AudioHardwareCreateProcessTap`, macOS 14.2+): a tap created with `muteBehavior = CATapMuted` silences the tapped process while the tap exists. + +**HushKey uses option 2.** As a result: + +- ✅ Per-app **mute/unmute** works (that's all HushKey's shortcuts need). +- ❌ Per-app **volume levels** are not possible. The backend reports `per_app_volume: false`, the UI hides volume bars, and `set_app_volume` returns `Unsupported` for values between 0 and 1. It never fakes a level. +- Requires **macOS 14.2+**. The tap functions are resolved with `dlsym` at runtime, so the binary still launches on older macOS. There, apps are listed read-only and a banner explains why. +- Requires the **Screen & System Audio Recording** permission. The app bundle must declare `NSAudioCaptureUsageDescription` (see [building.md](building.md#macos)). +- Apps are grouped by their outermost `.app` bundle, so helper processes (e.g. Chrome's renderer helpers) are muted together. When an app spawns a new helper while muted, the tap is rebuilt on the next refresh. + +> ⚠️ The macOS backend was written and compile-checked (`cargo check --target aarch64-apple-darwin`) but **not yet run on real hardware**. Please report results. + +### Wayland global shortcuts + +Wayland deliberately has no API for one client to grab keys globally. The `global-hotkey` crate uses X11 `XGrabKey`, which under Wayland only sees XWayland clients. The XDG `GlobalShortcuts` portal exists but isn't supported by the hotkey crate and isn't implemented by every compositor. Registration appears to succeed through XWayland but never fires for native Wayland windows, so HushKey checks `XDG_SESSION_TYPE` at startup and shows a warning banner. A future version could adopt the portal and add a CLI (`hushkey toggle `) for desktop-level bindings. + +### Linux tray on GNOME + +GNOME Shell doesn't show StatusNotifierItem icons without an extension. If no tray host is found, HushKey keeps its window open so the app stays reachable. + +### Windows + +The Windows backend is fully native. Sessions are enumerated on every active output device, not just the default one, so apps routed to a headset or virtual device are found. Protected processes HushKey can't open are still controllable; they're listed as "Process " with a PID-based key, which can't be bound persistently. diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..c775577 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +max_width = 120 +use_small_heuristics = "Max" diff --git a/src/app.rs b/src/app.rs new file mode 100644 index 0000000..2edc793 --- /dev/null +++ b/src/app.rs @@ -0,0 +1,678 @@ +//! Application controller. Lives on the main (Slint event-loop) thread and glues the +//! UI, config, hotkeys, tray and the audio worker together. +//! +//! Memory strategy: the main window is *destroyed* when closed (not just hidden) and +//! rebuilt on demand from the state kept here, so the idle tray app holds no window +//! surfaces, render buffers or UI trees. + +use crate::audio::worker::{self, AudioCommand, AudioEvent, AudioHandle}; +use crate::audio::{AudioApp, Capabilities}; +use crate::config::{Config, ConfigStore, Theme}; +use crate::hotkeys::{capture_from_key_event, Accelerator, Capture, HotkeyAction, Hotkeys}; +use crate::platform; +use crate::ui::icon::{self, IconState}; +use crate::ui::toast::ToastPresenter; +use crate::ui::tray::{Tray, TrayCommand}; +use crate::{AppRow, MainWindow}; +use slint::{ComponentHandle, Model, ModelRc, SharedString, VecModel}; +use std::cell::{Cell, RefCell}; +use std::collections::HashMap; +use std::rc::Rc; +use std::time::Duration; + +const REFRESH_EVERY: Duration = Duration::from_millis(1500); +const TARGET_ALL: &str = "@all"; +const TARGET_RESTORE: &str = "@restore"; + +thread_local! { + static APP: RefCell>> = const { RefCell::new(None) }; +} + +/// Run `f` with the app, if it exists. Safe to call from any event-loop callback. +pub fn with_app(f: impl FnOnce(&Rc) -> R) -> Option { + let app = APP.with(|a| a.borrow().clone()); + app.map(|a| f(&a)) +} + +pub fn with_toast(f: impl FnOnce(&mut ToastPresenter)) { + with_app(|a| f(&mut a.toast.borrow_mut())); +} + +pub struct App { + cfg: RefCell, + store: ConfigStore, + audio: RefCell>, + hotkeys: RefCell>, + tray: RefCell>, + toast: RefCell, + window: RefCell>, + rows: Rc>, + apps: RefCell>, + icons: RefCell>, + all_muted: Cell, + caps: Cell, + backend: RefCell, + platform_note: RefCell, + capturing: RefCell>, + status: RefCell<(String, bool)>, + refresh_timer: slint::Timer, +} + +impl App { + pub fn start(start_hidden: bool) -> Rc { + let store = ConfigStore::default_location().unwrap_or_else(|| ConfigStore::new("hushkey.toml".into())); + let cfg = store.load(); + log::info!("config: {}", store.path().display()); + + let audio = worker::spawn(|ev| { + let _ = slint::invoke_from_event_loop(move || { + with_app(|a| a.on_audio_event(ev)); + }); + }); + + // Hot path: OS hotkey callback → audio thread, no UI hop. + let tx = audio.sender(); + let hotkeys = match Hotkeys::new(move |action| { + let cmd = match action { + HotkeyAction::ToggleApp(key) => AudioCommand::ToggleApp { key, from_hotkey: true }, + HotkeyAction::ToggleAll => AudioCommand::ToggleAll { from_hotkey: true }, + HotkeyAction::RestoreAll => AudioCommand::RestoreAll { from_hotkey: true }, + }; + let _ = tx.send(cmd); + }) { + Ok(h) => Some(h), + Err(e) => { + log::error!("global hotkeys unavailable: {e}"); + None + } + }; + + let app = Rc::new(App { + cfg: RefCell::new(cfg), + store, + audio: RefCell::new(Some(audio)), + hotkeys: RefCell::new(hotkeys), + tray: RefCell::new(None), + toast: RefCell::new(ToastPresenter::new()), + window: RefCell::new(None), + rows: Rc::new(VecModel::default()), + apps: RefCell::default(), + icons: RefCell::default(), + all_muted: Cell::new(false), + caps: Cell::new(Capabilities { per_app_volume: true, per_app_mute: true }), + backend: RefCell::new("starting…".into()), + platform_note: RefCell::default(), + capturing: RefCell::new(None), + status: RefCell::default(), + refresh_timer: slint::Timer::default(), + }); + APP.with(|a| *a.borrow_mut() = Some(app.clone())); + + if app.hotkeys.borrow().is_none() { + app.set_status("Global shortcuts are unavailable on this system. See the README.", true); + } else { + app.apply_hotkeys(); + } + // Registration "succeeds" through XWayland but never sees native Wayland focus, + // so warn explicitly instead of failing silently. + #[cfg(target_os = "linux")] + if std::env::var("XDG_SESSION_TYPE").is_ok_and(|v| v.eq_ignore_ascii_case("wayland")) { + app.set_status( + "Wayland session: global shortcuts only fire while an X11/XWayland window is focused. Log into an X11 session for full support (see docs/building.md).", + true, + ); + } + if app.cfg.borrow().settings.launch_on_startup { + // Re-register so the entry follows the exe if it was moved/updated. + let _ = platform::set_launch_on_startup(true); + } + + // Tray must be created once the event loop runs (required on macOS). + slint::Timer::single_shot(Duration::ZERO, || { + with_app(|a| a.init_tray()); + }); + if !start_hidden { + app.show_window(); + } + app.send(AudioCommand::Refresh); + app + } + + /// Tear down in a safe order. Restores anything Mute All silenced. + pub fn shutdown() { + let Some(app) = APP.with(|a| a.borrow_mut().take()) else { return }; + app.refresh_timer.stop(); + app.window.borrow_mut().take(); + app.tray.borrow_mut().take(); + app.hotkeys.borrow_mut().take(); + let audio = app.audio.borrow_mut().take(); + if let Some(audio) = audio { + audio.shutdown(); + } + } + + fn send(&self, cmd: AudioCommand) { + if let Some(a) = self.audio.borrow().as_ref() { + a.send(cmd); + } + } + + // ── Tray ─────────────────────────────────────────────────────────────────── + + fn init_tray(&self) { + match Tray::new(|cmd| { + with_app(|a| match cmd { + TrayCommand::Open => a.show_window(), + TrayCommand::ToggleAll => a.send(AudioCommand::ToggleAll { from_hotkey: false }), + TrayCommand::Quit => { + let _ = slint::quit_event_loop(); + } + }); + }) { + Ok(mut t) => { + t.set_all_muted(self.all_muted.get()); + *self.tray.borrow_mut() = Some(t); + } + Err(e) => { + log::error!("tray icon unavailable: {e}"); + // Without a tray the user would have no way back in: keep the window up. + self.show_window(); + self.set_status( + "No system tray found — closing this window will keep HushKey running in the background.", + true, + ); + } + } + } + + // ── Window lifecycle ─────────────────────────────────────────────────────── + + pub fn show_window(&self) { + if self.window.borrow().is_none() { + match self.build_window() { + Ok(w) => *self.window.borrow_mut() = Some(w), + Err(e) => { + log::error!("cannot create window: {e}"); + return; + } + } + } + if let Some(w) = self.window.borrow().as_ref() { + self.push_all(w); + let _ = w.show(); + use slint::winit_030::WinitWindowAccessor; + let dark = self.cfg.borrow().settings.theme == Theme::Dark; + w.window().with_winit_window(|ww| { + apply_native_chrome(ww, dark); + ww.set_minimized(false); + ww.focus_window(); + }); + } + self.send(AudioCommand::Refresh); + self.refresh_timer.start(slint::TimerMode::Repeated, REFRESH_EVERY, || { + with_app(|a| a.send(AudioCommand::Refresh)); + }); + } + + /// Destroy the window (called after it was closed) to give the memory back. + fn release_window(&self) { + if self.capturing.borrow().is_some() { + self.end_capture(); + } + self.refresh_timer.stop(); + if let Some(w) = self.window.borrow_mut().take() { + let _ = w.hide(); + } + } + + fn build_window(&self) -> Result { + let w = MainWindow::new()?; + w.set_app_icon(crate::ui::icon_image(64, IconState::Normal)); + w.set_version(env!("CARGO_PKG_VERSION").into()); + w.set_config_path(self.store.path().display().to_string().into()); + w.set_apps(ModelRc::from(self.rows.clone())); + + w.window().on_close_requested(|| { + // Can't drop the component from inside its own callback; do it next tick. + slint::Timer::single_shot(Duration::ZERO, || { + with_app(|a| a.release_window()); + }); + slint::CloseRequestResponse::HideWindow + }); + + w.on_start_capture(|t| { + with_app(|a| a.start_capture(t.as_str())); + }); + w.on_key_captured(|text, ctrl, alt, shift, meta| { + with_app(|a| a.key_captured(text.as_str(), ctrl, alt, shift, meta)); + }); + w.on_cancel_capture(|| { + with_app(|a| a.end_capture()); + }); + w.on_clear_shortcut(|t| { + with_app(|a| a.set_shortcut(t.as_str(), None)); + }); + w.on_toggle_app(|key| { + with_app(|a| a.send(AudioCommand::ToggleApp { key: key.to_string(), from_hotkey: false })); + }); + w.on_toggle_all(|| { + with_app(|a| a.send(AudioCommand::ToggleAll { from_hotkey: false })); + }); + w.on_refresh(|| { + with_app(|a| a.send(AudioCommand::Refresh)); + }); + w.on_dismiss_status(|| { + with_app(|a| a.set_status("", false)); + }); + w.on_open_config_dir(|| { + with_app(|a| { + if let Some(dir) = a.store.path().parent() { + platform::open_folder(dir); + } + }); + }); + w.on_set_launch_on_startup(|v| { + with_app(|a| match platform::set_launch_on_startup(v) { + Ok(()) => a.update_settings(|s| s.launch_on_startup = v), + Err(e) => { + a.set_status(&format!("Couldn't change launch-at-login: {e}"), true); + a.push_settings(); + } + }); + }); + w.on_set_start_minimized(|v| { + with_app(|a| a.update_settings(|s| s.start_minimized = v)); + }); + w.on_set_show_toast(|v| { + with_app(|a| a.update_settings(|s| s.show_toast = v)); + }); + w.on_set_dark(|dark| { + with_app(|a| a.update_settings(|s| s.theme = if dark { Theme::Dark } else { Theme::Light })); + }); + Ok(w) + } + + fn ui(&self) -> Option { + self.window.borrow().as_ref().map(|w| w.clone_strong()) + } + + fn push_all(&self, w: &MainWindow) { + w.set_backend(self.backend.borrow().as_str().into()); + w.set_platform_note(self.platform_note.borrow().as_str().into()); + w.set_show_volume(self.caps.get().per_app_volume); + w.set_all_muted(self.all_muted.get()); + let (msg, err) = self.status.borrow().clone(); + w.set_status(msg.into()); + w.set_status_is_error(err); + w.set_capturing(self.capturing.borrow().clone().unwrap_or_default().into()); + w.set_hotkey_hint("Press a combo · Esc cancels · Backspace clears".into()); + self.push_settings_to(w); + self.push_shortcuts_to(w); + self.sync_rows(); + } + + fn push_settings(&self) { + if let Some(w) = self.ui() { + self.push_settings_to(&w); + } + } + + fn push_settings_to(&self, w: &MainWindow) { + let s = &self.cfg.borrow().settings; + let dark = s.theme == Theme::Dark; + w.set_dark(dark); + use slint::winit_030::WinitWindowAccessor; + w.window().with_winit_window(|ww| apply_native_chrome(ww, dark)); + w.set_launch_on_startup(s.launch_on_startup); + w.set_start_minimized(s.start_minimized); + w.set_show_toast(s.show_toast); + } + + fn push_shortcuts_to(&self, w: &MainWindow) { + let cfg = self.cfg.borrow(); + w.set_mute_all_shortcut(label(cfg.mute_all.hotkey.as_deref()).into()); + w.set_restore_shortcut(label(cfg.mute_all.restore_hotkey.as_deref()).into()); + } + + fn set_status(&self, msg: &str, is_error: bool) { + *self.status.borrow_mut() = (msg.to_owned(), is_error); + if let Some(w) = self.ui() { + w.set_status(msg.into()); + w.set_status_is_error(is_error); + } + } + + // ── Rows ─────────────────────────────────────────────────────────────────── + + fn sync_rows(&self) { + let cfg = self.cfg.borrow(); + let apps = self.apps.borrow(); + let icons = self.icons.borrow(); + let caps = self.caps.get(); + + let mut rows: Vec = Vec::with_capacity(apps.len() + cfg.bindings.len()); + for a in apps.iter() { + let status = if a.muted { + "Muted".to_owned() + } else if let (true, Some(v)) = (caps.per_app_volume, a.volume) { + format!("Volume {}%", (v * 100.0).round()) + } else { + "Active".to_owned() + }; + rows.push(make_row( + &a.key, + &a.name, + &format!("{status} · {}", a.key), + true, + a.muted, + a.volume, + &cfg, + &icons, + )); + } + // Bound apps that aren't running stay visible so their shortcut can be edited. + for b in &cfg.bindings { + if !apps.iter().any(|a| a.key == b.app) { + let name = if b.display_name.is_empty() { &b.app } else { &b.display_name }; + rows.push(make_row( + &b.app, + name, + &format!("Not running · {}", b.app), + false, + false, + None, + &cfg, + &icons, + )); + } + } + + let same_shape = self.rows.row_count() == rows.len() + && rows.iter().enumerate().all(|(i, r)| self.rows.row_data(i).is_some_and(|old| old.key == r.key)); + if same_shape { + for (i, r) in rows.into_iter().enumerate() { + if self.rows.row_data(i).as_ref() != Some(&r) { + self.rows.set_row_data(i, r); + } + } + } else { + self.rows.set_vec(rows); + } + if let Some(w) = self.ui() { + w.set_running_count(apps.len() as i32); + } + } + + // ── Audio events ─────────────────────────────────────────────────────────── + + fn on_audio_event(&self, ev: AudioEvent) { + match ev { + AudioEvent::Ready { backend, caps, note } => { + *self.backend.borrow_mut() = backend.to_owned(); + *self.platform_note.borrow_mut() = note.unwrap_or_default().to_owned(); + self.caps.set(caps); + if let Some(w) = self.ui() { + self.push_all(&w); + } + } + AudioEvent::Apps(apps) => { + *self.apps.borrow_mut() = apps; + self.sync_rows(); + } + AudioEvent::Icon { key, icon } => { + self.icons.borrow_mut().insert(key, crate::ui::image_from_icon(&icon)); + self.sync_rows(); + } + AudioEvent::Toggled { outcome, from_hotkey } => { + // Keep the friendly name for bindings of apps that later quit. + let renamed = { + let mut cfg = self.cfg.borrow_mut(); + match cfg.bindings.iter_mut().find(|b| b.app == outcome.key && b.display_name != outcome.name) { + Some(b) => { + b.display_name = outcome.name.clone(); + true + } + None => false, + } + }; + if renamed { + self.save(); + } + if from_hotkey { + let detail = self.shortcut_label_for(&outcome.key); + let headline = format!("{} {}", outcome.name, if outcome.muted { "muted" } else { "unmuted" }); + self.feedback(&headline, &detail, outcome.muted, false); + } + } + AudioEvent::AllMuted { muted, from_hotkey } => { + self.all_muted.set(muted); + if let Some(t) = self.tray.borrow_mut().as_mut() { + t.set_all_muted(muted); + } + if let Some(w) = self.ui() { + w.set_all_muted(muted); + } + if from_hotkey { + let (headline, detail) = if muted { + ("Everything muted", "Press the shortcut again to restore") + } else { + ("Audio restored", "Apps are back to how they were") + }; + self.feedback(headline, detail, muted, false); + } + } + AudioEvent::NotRunning { key, from_hotkey } => { + let name = self.display_name(&key); + if from_hotkey { + self.feedback(&name, "Isn't playing audio right now", false, true); + } else { + self.set_status(&format!("{name} isn't playing audio right now."), false); + } + } + AudioEvent::Error { message, from_hotkey } => { + log::warn!("{message}"); + if from_hotkey { + self.feedback("Couldn't change audio", &message, false, true); + } + self.set_status(&message, true); + } + AudioEvent::Fatal(message) => { + *self.backend.borrow_mut() = "unavailable".into(); + self.set_status(&format!("Audio control unavailable: {message}"), true); + } + } + } + + fn feedback(&self, headline: &str, detail: &str, muted: bool, error: bool) { + if let Some(t) = self.tray.borrow().as_ref() { + if !error { + t.flash(muted, || { + with_app(|a| { + if let Some(t) = a.tray.borrow().as_ref() { + t.settle(); + } + }); + }); + } + } + let (show, dark) = { + let s = &self.cfg.borrow().settings; + (s.show_toast, s.theme == Theme::Dark) + }; + if show { + self.toast.borrow_mut().show(dark, headline, detail, muted, error); + } + } + + fn display_name(&self, key: &str) -> String { + if let Some(a) = self.apps.borrow().iter().find(|a| a.key == key) { + return a.name.clone(); + } + self.cfg + .borrow() + .binding_for(key) + .map(|b| if b.display_name.is_empty() { b.app.clone() } else { b.display_name.clone() }) + .unwrap_or_else(|| key.to_owned()) + } + + fn shortcut_label_for(&self, key: &str) -> String { + label(self.cfg.borrow().binding_for(key).map(|b| b.hotkey.as_str())) + } + + // ── Shortcut capture ─────────────────────────────────────────────────────── + + fn start_capture(&self, target: &str) { + *self.capturing.borrow_mut() = Some(target.to_owned()); + // Release all global hotkeys so the combo reaches our window instead of firing. + if let Some(h) = self.hotkeys.borrow_mut().as_mut() { + h.suspend(); + } + if let Some(w) = self.ui() { + w.set_capturing(target.into()); + } + } + + fn end_capture(&self) { + *self.capturing.borrow_mut() = None; + if let Some(w) = self.ui() { + w.set_capturing(SharedString::default()); + } + self.apply_hotkeys(); + } + + fn key_captured(&self, text: &str, ctrl: bool, alt: bool, shift: bool, meta: bool) { + let Some(target) = self.capturing.borrow().clone() else { return }; + match capture_from_key_event(text, ctrl, alt, shift, meta) { + Capture::Pending => {} + Capture::Cancel => self.end_capture(), + Capture::Clear => self.set_shortcut(&target, None), + Capture::Invalid(why) => self.set_status(why, true), + Capture::Captured(acc) => { + if let Some(owner) = self.conflict(&target, acc) { + self.set_status(&format!("{} is already used by {owner}.", acc.label()), true); + return; + } + self.set_shortcut(&target, Some(acc)); + } + } + } + + /// Who else already uses `acc`, if anyone (ignoring `target` itself). + fn conflict(&self, target: &str, acc: Accelerator) -> Option { + let cfg = self.cfg.borrow(); + let same = |h: &str| h.parse::().ok() == Some(acc); + if target != TARGET_ALL && cfg.mute_all.hotkey.as_deref().is_some_and(same) { + return Some("Mute All".into()); + } + if target != TARGET_RESTORE && cfg.mute_all.restore_hotkey.as_deref().is_some_and(same) { + return Some("Restore All".into()); + } + cfg.bindings.iter().find(|b| b.app != target && same(&b.hotkey)).map(|b| { + if b.display_name.is_empty() { + b.app.clone() + } else { + b.display_name.clone() + } + }) + } + + fn set_shortcut(&self, target: &str, acc: Option) { + let value = acc.map(|a| a.to_string()); + { + let mut cfg = self.cfg.borrow_mut(); + match target { + TARGET_ALL => cfg.mute_all.hotkey = value, + TARGET_RESTORE => cfg.mute_all.restore_hotkey = value, + key => { + let name = self.display_name(key); + cfg.set_binding(key, &name, value); + } + } + } + self.save(); + self.set_status("", false); + if let Some(w) = self.ui() { + self.push_shortcuts_to(&w); + } + self.sync_rows(); + if self.capturing.borrow().is_some() { + self.end_capture(); // re-applies hotkeys + } else { + self.apply_hotkeys(); + } + } + + fn apply_hotkeys(&self) { + let errors = match self.hotkeys.borrow_mut().as_mut() { + Some(h) => h.apply(&self.cfg.borrow()), + None => return, + }; + if !errors.is_empty() { + self.set_status(&errors.join("\n"), true); + } + } + + // ── Settings ─────────────────────────────────────────────────────────────── + + fn update_settings(&self, f: impl FnOnce(&mut crate::config::Settings)) { + f(&mut self.cfg.borrow_mut().settings); + self.save(); + self.push_settings(); + } + + fn save(&self) { + if let Err(e) = self.store.save(&self.cfg.borrow()) { + log::error!("saving config: {e}"); + self.set_status(&format!("Couldn't save settings: {e}"), true); + } + } +} + +/// Title-bar theme (dark title bar on Windows 10/11, appearance on macOS) and window icon. +fn apply_native_chrome(w: &slint::winit_030::winit::window::Window, dark: bool) { + use slint::winit_030::winit::window::{Icon, Theme as WinitTheme}; + w.set_theme(Some(if dark { WinitTheme::Dark } else { WinitTheme::Light })); + // Small icon: title bar / Alt+Tab. + if let Ok(icon) = Icon::from_rgba(icon::render(32, IconState::Normal), 32, 32) { + w.set_window_icon(Some(icon)); + } + // Windows uses a separate "big" icon for the taskbar; winit only sets it on request. + #[cfg(target_os = "windows")] + { + use slint::winit_030::winit::platform::windows::WindowExtWindows; + if let Ok(icon) = Icon::from_rgba(icon::render(64, IconState::Normal), 64, 64) { + w.set_taskbar_icon(Some(icon)); + } + } +} + +fn label(hotkey: Option<&str>) -> String { + hotkey.and_then(|h| h.parse::().ok()).map(|a| a.label()).unwrap_or_default() +} + +#[allow(clippy::too_many_arguments)] +fn make_row( + key: &str, + name: &str, + subtitle: &str, + running: bool, + muted: bool, + volume: Option, + cfg: &Config, + icons: &HashMap, +) -> AppRow { + let icon = icons.get(key).cloned(); + AppRow { + key: key.into(), + name: name.into(), + subtitle: subtitle.into(), + has_icon: icon.is_some(), + icon: icon.unwrap_or_default(), + initial: crate::ui::initial_for(name).into(), + tint: crate::ui::tint_for(key), + running, + muted, + volume: volume.unwrap_or(-1.0), + shortcut: label(cfg.binding_for(key).map(|b| b.hotkey.as_str())).into(), + } +} diff --git a/src/audio/linux.rs b/src/audio/linux.rs new file mode 100644 index 0000000..f2a9894 --- /dev/null +++ b/src/audio/linux.rs @@ -0,0 +1,168 @@ +//! Linux backend: PulseAudio sink inputs (also works on PipeWire via `pipewire-pulse`, +//! the default on Fedora, Ubuntu 22.10+, Arch, etc.). +//! +//! Every playback stream an app opens is a *sink input*; that includes paused/corked +//! streams, so idle-but-registered apps show up too. Full per-app volume and mute are +//! natively supported. +//! +//! Uses the single-threaded standard mainloop driven synchronously from the audio worker +//! thread: each call issues an operation and iterates the loop until it completes. + +use super::{AudioApp, AudioController, AudioError, AudioResult, Capabilities}; +use libpulse_binding as pulse; +use pulse::callbacks::ListResult; +use pulse::context::{Context, FlagSet, State}; +use pulse::mainloop::standard::{IterateResult, Mainloop}; +use pulse::operation::{Operation, State as OpState}; +use pulse::proplist::{properties, Proplist}; +use pulse::volume::{ChannelVolumes, Volume}; +use std::cell::RefCell; +use std::collections::BTreeMap; +use std::rc::Rc; + +#[derive(Clone)] +struct Input { + index: u32, + key: String, + name: String, + pid: u32, + muted: bool, + volume: f32, + channels: u8, +} + +pub struct PulseController { + mainloop: Mainloop, + context: Context, +} + +fn backend(msg: impl Into) -> AudioError { + AudioError::Backend(msg.into()) +} + +impl PulseController { + pub fn new() -> AudioResult { + let mut props = Proplist::new().ok_or_else(|| backend("Proplist::new failed"))?; + let _ = props.set_str(properties::APPLICATION_NAME, "HushKey"); + let _ = props.set_str(properties::APPLICATION_ID, "io.github.hushkey"); + let mut mainloop = Mainloop::new().ok_or_else(|| backend("PulseAudio mainloop unavailable"))?; + let mut context = Context::new_with_proplist(&mainloop, "HushKey", &props) + .ok_or_else(|| backend("PulseAudio context failed"))?; + context + .connect(None, FlagSet::NOFLAGS, None) + .map_err(|e| backend(format!("cannot connect to PulseAudio/PipeWire: {e}")))?; + loop { + match mainloop.iterate(true) { + IterateResult::Success(_) => {} + IterateResult::Quit(_) | IterateResult::Err(_) => return Err(backend("PulseAudio mainloop failed")), + } + match context.get_state() { + State::Ready => break, + State::Failed | State::Terminated => { + return Err(backend("no PulseAudio server (is pipewire-pulse or pulseaudio running?)")) + } + _ => {} + } + } + Ok(Self { mainloop, context }) + } + + fn wait(&mut self, op: Operation) -> AudioResult<()> { + while op.get_state() == OpState::Running { + if let IterateResult::Quit(_) | IterateResult::Err(_) = self.mainloop.iterate(true) { + return Err(backend("PulseAudio connection lost")); + } + } + Ok(()) + } + + fn inputs(&mut self) -> AudioResult> { + let out: Rc>> = Rc::default(); + let sink = out.clone(); + let op = self.context.introspect().get_sink_input_info_list(move |r| { + if let ListResult::Item(i) = r { + let get = |k: &str| i.proplist.get_str(k).filter(|s| !s.is_empty()); + let binary = get(properties::APPLICATION_PROCESS_BINARY); + let app_name = get(properties::APPLICATION_NAME); + let key = binary.clone().or_else(|| app_name.clone()).unwrap_or_else(|| format!("stream-{}", i.index)); + let name = app_name.or(binary).unwrap_or_else(|| key.clone()); + let pid = get(properties::APPLICATION_PROCESS_ID).and_then(|p| p.parse().ok()).unwrap_or(0); + sink.borrow_mut().push(Input { + index: i.index, + key: key.to_lowercase(), + name, + pid, + muted: i.mute, + volume: i.volume.avg().0 as f32 / Volume::NORMAL.0 as f32, + channels: i.volume.len(), + }); + } + }); + self.wait(op)?; + let v = out.borrow().clone(); + Ok(v) + } + + fn for_each_input_of( + &mut self, + app: &str, + mut f: impl FnMut(&mut Self, &Input) -> Operation, + ) -> AudioResult<()> { + let inputs: Vec = self.inputs()?.into_iter().filter(|i| i.key == app).collect(); + if inputs.is_empty() { + return Err(AudioError::NotRunning(app.into())); + } + for input in &inputs { + let op = f(self, input); + self.wait(op)?; + } + Ok(()) + } +} + +impl AudioController for PulseController { + fn backend_name(&self) -> &'static str { + "PulseAudio / PipeWire" + } + + fn capabilities(&self) -> Capabilities { + Capabilities { per_app_volume: true, per_app_mute: true } + } + + fn list_audio_apps(&mut self) -> AudioResult> { + let mut grouped: BTreeMap> = BTreeMap::new(); + for i in self.inputs()? { + grouped.entry(i.key.clone()).or_default().push(i); + } + let mut apps: Vec = grouped + .into_iter() + .map(|(key, ins)| { + let mut pids: Vec = ins.iter().map(|i| i.pid).filter(|p| *p != 0).collect(); + pids.dedup(); + AudioApp { + name: ins[0].name.clone(), + volume: Some(ins.iter().map(|i| i.volume).sum::() / ins.len() as f32), + muted: ins.iter().all(|i| i.muted), + exe_path: pids.first().and_then(|p| std::fs::read_link(format!("/proc/{p}/exe")).ok()), + pids, + key, + } + }) + .collect(); + apps.sort_by_key(|a| a.name.to_lowercase()); + Ok(apps) + } + + fn set_app_volume(&mut self, app: &str, volume: f32) -> AudioResult<()> { + let level = Volume((volume.clamp(0.0, 1.0) * Volume::NORMAL.0 as f32) as u32); + self.for_each_input_of(app, |me, input| { + let mut cv = ChannelVolumes::default(); + cv.set(input.channels.max(1), level); + me.context.introspect().set_sink_input_volume(input.index, &cv, None) + }) + } + + fn set_app_mute(&mut self, app: &str, muted: bool) -> AudioResult<()> { + self.for_each_input_of(app, |me, input| me.context.introspect().set_sink_input_mute(input.index, muted, None)) + } +} diff --git a/src/audio/macos.rs b/src/audio/macos.rs new file mode 100644 index 0000000..e93aef9 --- /dev/null +++ b/src/audio/macos.rs @@ -0,0 +1,360 @@ +//! macOS backend: Core Audio **process taps** (macOS 14.2+). +//! +//! # Platform limitation — read before editing +//! +//! macOS has no public API to set another application's output volume. The options are: +//! 1. Install a virtual audio driver (what SoundSource / Background Music do) — needs a +//! kernel/HAL plug-in install and admin rights. Rejected: too invasive for a hotkey tool. +//! 2. **Core Audio process taps** (`AudioHardwareCreateProcessTap`, macOS 14.2+). A tap +//! created with `muteBehavior = CATapMuted` silences the tapped process for as long as +//! the tap exists. ← what HushKey uses. +//! +//! Consequences: +//! - Per-app **mute works**; per-app **volume levels do not** (`per_app_volume: false`). +//! `set_app_volume` accepts only 0.0 (mute) and 1.0 (unmute) and reports `Unsupported` +//! for anything in between — it never fakes a level. +//! - Requires macOS 14.2+. On older systems the symbols are absent; we look them up with +//! `dlsym` (never hard-link them, or the binary would fail to launch on macOS 13) and +//! fall back to listing apps read-only. +//! - The user must grant the audio-capture permission ("Screen & System Audio Recording" +//! in System Settings → Privacy & Security). The app bundle's Info.plist needs +//! `NSAudioCaptureUsageDescription` (see docs/building.md). +//! - Crash-safe: taps belong to our process, so if HushKey exits or crashes every muted +//! app becomes audible again automatically. +//! +//! **Untested on real hardware by the original author** (developed on Windows, compile- +//! checked for `aarch64-apple-darwin`). Reports from macOS users are very welcome. + +use super::{AudioApp, AudioController, AudioError, AudioResult, Capabilities}; +use objc2::msg_send; +use objc2::rc::Retained; +use objc2::runtime::{AnyClass, AnyObject}; +use objc2_foundation::{NSArray, NSNumber, NSString}; +use std::collections::{BTreeMap, HashMap}; +use std::ffi::c_void; +use std::path::PathBuf; + +type AudioObjectID = u32; +type OSStatus = i32; + +#[repr(C)] +struct AudioObjectPropertyAddress { + selector: u32, + scope: u32, + element: u32, +} + +const fn fourcc(s: &[u8; 4]) -> u32 { + ((s[0] as u32) << 24) | ((s[1] as u32) << 16) | ((s[2] as u32) << 8) | (s[3] as u32) +} + +const K_AUDIO_OBJECT_SYSTEM_OBJECT: AudioObjectID = 1; +const K_SCOPE_GLOBAL: u32 = fourcc(b"glob"); +const K_ELEMENT_MAIN: u32 = 0; +const K_HW_PROCESS_OBJECT_LIST: u32 = fourcc(b"prs#"); +const K_PROCESS_PID: u32 = fourcc(b"ppid"); +const K_PROCESS_BUNDLE_ID: u32 = fourcc(b"pbid"); +const K_PROCESS_IS_RUNNING_OUTPUT: u32 = fourcc(b"piro"); +/// `CATapMuteBehavior.CATapMuted` +const CA_TAP_MUTED: isize = 1; + +#[link(name = "CoreAudio", kind = "framework")] +extern "C" { + fn AudioObjectGetPropertyDataSize( + id: AudioObjectID, + addr: *const AudioObjectPropertyAddress, + qualifier_size: u32, + qualifier: *const c_void, + out_size: *mut u32, + ) -> OSStatus; + fn AudioObjectGetPropertyData( + id: AudioObjectID, + addr: *const AudioObjectPropertyAddress, + qualifier_size: u32, + qualifier: *const c_void, + io_size: *mut u32, + out: *mut c_void, + ) -> OSStatus; +} + +type CreateTapFn = unsafe extern "C" fn(*mut AnyObject, *mut AudioObjectID) -> OSStatus; +type DestroyTapFn = unsafe extern "C" fn(AudioObjectID) -> OSStatus; + +struct TapApi { + create: CreateTapFn, + destroy: DestroyTapFn, + description_class: &'static AnyClass, +} + +impl TapApi { + /// Resolve the macOS 14.2+ tap API at runtime. + fn load() -> Option { + unsafe { + let create = libc::dlsym(libc::RTLD_DEFAULT, c"AudioHardwareCreateProcessTap".as_ptr()); + let destroy = libc::dlsym(libc::RTLD_DEFAULT, c"AudioHardwareDestroyProcessTap".as_ptr()); + if create.is_null() || destroy.is_null() { + return None; + } + Some(Self { + create: std::mem::transmute::<*mut c_void, CreateTapFn>(create), + destroy: std::mem::transmute::<*mut c_void, DestroyTapFn>(destroy), + description_class: AnyClass::get(c"CATapDescription")?, + }) + } + } +} + +struct Process { + object: AudioObjectID, + pid: u32, + running_output: bool, + key: String, + name: String, + path: Option, +} + +struct Tap { + id: AudioObjectID, + objects: Vec, +} + +pub struct CoreAudioTapController { + api: Option, + taps: HashMap, +} + +impl CoreAudioTapController { + pub fn new() -> AudioResult { + let api = TapApi::load(); + if api.is_none() { + log::warn!("Core Audio process taps unavailable (needs macOS 14.2+); muting disabled"); + } + Ok(Self { api, taps: HashMap::new() }) + } + + fn processes(&self) -> AudioResult> { + let objects: Vec = unsafe { get_array(K_AUDIO_OBJECT_SYSTEM_OBJECT, K_HW_PROCESS_OBJECT_LIST)? }; + let mut out = Vec::new(); + for object in objects { + let pid = unsafe { get_scalar::(object, K_PROCESS_PID) }.unwrap_or(-1); + if pid <= 0 || pid as u32 == std::process::id() { + continue; + } + let running_output = unsafe { get_scalar::(object, K_PROCESS_IS_RUNNING_OUTPUT) }.unwrap_or(0) != 0; + let bundle_id = unsafe { get_cfstring(object, K_PROCESS_BUNDLE_ID) }.unwrap_or_default(); + let path = pid_path(pid); + let (key, name) = identify(path.as_ref(), &bundle_id); + out.push(Process { object, pid: pid as u32, running_output, key, name, path }); + } + Ok(out) + } + + fn create_tap(&self, objects: &[AudioObjectID]) -> AudioResult { + let api = self.api.as_ref().ok_or(AudioError::Unsupported("per-app mute requires macOS 14.2 or newer"))?; + unsafe { + let numbers: Vec> = objects.iter().map(|o| NSNumber::new_u32(*o)).collect(); + let array = NSArray::from_retained_slice(&numbers); + let alloc: *mut AnyObject = msg_send![api.description_class, alloc]; + let desc: *mut AnyObject = msg_send![alloc, initStereoMixdownOfProcesses: &*array]; + if desc.is_null() { + return Err(AudioError::Backend("CATapDescription init failed".into())); + } + let desc: Retained = Retained::from_raw(desc).expect("non-null"); + let name = NSString::from_str("HushKey mute"); + let _: () = msg_send![&*desc, setName: &*name]; + let _: () = msg_send![&*desc, setPrivate: true]; + let _: () = msg_send![&*desc, setMuteBehavior: CA_TAP_MUTED]; + let mut tap: AudioObjectID = 0; + let status = (api.create)(Retained::as_ptr(&desc) as *mut AnyObject, &mut tap); + if status != 0 { + return Err(AudioError::PermissionDenied(format!( + "macOS refused to create an audio tap (OSStatus {status}). Allow HushKey under System Settings → \ + Privacy & Security → Screen & System Audio Recording." + ))); + } + Ok(tap) + } + } + + fn destroy_tap(&mut self, key: &str) { + if let (Some(tap), Some(api)) = (self.taps.remove(key), self.api.as_ref()) { + let status = unsafe { (api.destroy)(tap.id) }; + if status != 0 { + log::warn!("AudioHardwareDestroyProcessTap({}) = {status}", tap.id); + } + } + } +} + +impl Drop for CoreAudioTapController { + fn drop(&mut self) { + let keys: Vec = self.taps.keys().cloned().collect(); + for k in keys { + self.destroy_tap(&k); + } + } +} + +impl AudioController for CoreAudioTapController { + fn backend_name(&self) -> &'static str { + "macOS Core Audio process taps" + } + + fn capabilities(&self) -> Capabilities { + Capabilities { per_app_volume: false, per_app_mute: self.api.is_some() } + } + + fn list_audio_apps(&mut self) -> AudioResult> { + let procs = self.processes()?; + let mut grouped: BTreeMap> = BTreeMap::new(); + for p in &procs { + // Show real apps (inside an .app bundle), anything currently playing, and anything we muted. + let is_app = p.path.as_ref().is_some_and(|p| p.to_string_lossy().contains(".app/")); + if is_app || p.running_output || self.taps.contains_key(&p.key) { + grouped.entry(p.key.clone()).or_default().push(p); + } + } + + // Drop taps for apps that quit; re-tap apps whose process set changed (new helper process). + let stale: Vec = self.taps.keys().filter(|k| !grouped.contains_key(*k)).cloned().collect(); + for k in stale { + self.destroy_tap(&k); + } + let mut retap = Vec::new(); + for (key, ps) in &grouped { + if let Some(tap) = self.taps.get(key) { + let mut now: Vec = ps.iter().map(|p| p.object).collect(); + now.sort_unstable(); + if now != tap.objects { + retap.push((key.clone(), now)); + } + } + } + for (key, objects) in retap { + self.destroy_tap(&key); + if let Ok(id) = self.create_tap(&objects) { + self.taps.insert(key, Tap { id, objects }); + } + } + + let apps = grouped + .into_iter() + .map(|(key, ps)| AudioApp { + muted: self.taps.contains_key(&key), + name: ps[0].name.clone(), + pids: ps.iter().map(|p| p.pid).collect(), + volume: None, // not readable per-app on macOS + exe_path: ps[0].path.clone(), + key, + }) + .collect::>(); + let mut apps = apps; + apps.sort_by_key(|a| a.name.to_lowercase()); + Ok(apps) + } + + fn set_app_volume(&mut self, app: &str, volume: f32) -> AudioResult<()> { + if volume <= 0.0 { + self.set_app_mute(app, true) + } else if volume >= 1.0 { + self.set_app_mute(app, false) + } else { + Err(AudioError::Unsupported("per-app volume levels on macOS (mute/unmute only)")) + } + } + + fn set_app_mute(&mut self, app: &str, muted: bool) -> AudioResult<()> { + let mut objects: Vec = + self.processes()?.into_iter().filter(|p| p.key == app).map(|p| p.object).collect(); + if objects.is_empty() { + self.destroy_tap(app); + return Err(AudioError::NotRunning(app.into())); + } + objects.sort_unstable(); + if muted { + if !self.taps.contains_key(app) { + let id = self.create_tap(&objects)?; + self.taps.insert(app.to_owned(), Tap { id, objects }); + } + } else { + self.destroy_tap(app); + } + Ok(()) + } + + fn platform_note(&self) -> Option<&'static str> { + Some(if self.api.is_some() { + "macOS can mute individual apps but can't set their volume level. Muting needs the \ + Screen & System Audio Recording permission." + } else { + "Per-app muting needs macOS 14.2 or newer. Apps are listed read-only." + }) + } +} + +/// Key + display name. Helper processes (e.g. "Google Chrome Helper (Renderer).app" inside +/// "Google Chrome.app") resolve to the *outermost* bundle so they group under their app. +fn identify(path: Option<&PathBuf>, bundle_id: &str) -> (String, String) { + if let Some(p) = path { + let s = p.to_string_lossy(); + if let Some(end) = s.find(".app/") { + let bundle_path = &s[..end]; + let name = bundle_path.rsplit('/').next().unwrap_or(bundle_path).to_owned(); + return (format!("{}.app", name.to_lowercase()), name); + } + } + if !bundle_id.is_empty() { + let name = bundle_id.rsplit('.').next().unwrap_or(bundle_id).to_owned(); + return (bundle_id.to_lowercase(), name); + } + let exe = + path.and_then(|p| p.file_name()).map(|f| f.to_string_lossy().into_owned()).unwrap_or_else(|| "unknown".into()); + (exe.to_lowercase(), exe) +} + +fn pid_path(pid: i32) -> Option { + let mut buf = vec![0u8; libc::PROC_PIDPATHINFO_MAXSIZE as usize]; + let n = unsafe { libc::proc_pidpath(pid, buf.as_mut_ptr() as *mut c_void, buf.len() as u32) }; + if n <= 0 { + return None; + } + buf.truncate(n as usize); + Some(PathBuf::from(String::from_utf8_lossy(&buf).into_owned())) +} + +fn addr(selector: u32) -> AudioObjectPropertyAddress { + AudioObjectPropertyAddress { selector, scope: K_SCOPE_GLOBAL, element: K_ELEMENT_MAIN } +} + +unsafe fn get_array(object: AudioObjectID, selector: u32) -> AudioResult> { + let a = addr(selector); + let mut size = 0u32; + let status = AudioObjectGetPropertyDataSize(object, &a, 0, std::ptr::null(), &mut size); + if status != 0 { + return Err(AudioError::Backend(format!("AudioObjectGetPropertyDataSize = {status}"))); + } + let mut out = vec![T::default(); size as usize / std::mem::size_of::()]; + let status = + AudioObjectGetPropertyData(object, &a, 0, std::ptr::null(), &mut size, out.as_mut_ptr() as *mut c_void); + if status != 0 { + return Err(AudioError::Backend(format!("AudioObjectGetPropertyData = {status}"))); + } + out.truncate(size as usize / std::mem::size_of::()); + Ok(out) +} + +unsafe fn get_scalar(object: AudioObjectID, selector: u32) -> Option { + let a = addr(selector); + let mut v = T::default(); + let mut size = std::mem::size_of::() as u32; + let status = + AudioObjectGetPropertyData(object, &a, 0, std::ptr::null(), &mut size, &mut v as *mut T as *mut c_void); + (status == 0).then_some(v) +} + +/// Reads a `CFStringRef` property (returned +1 retained; toll-free bridged to `NSString`). +unsafe fn get_cfstring(object: AudioObjectID, selector: u32) -> Option { + let raw: *mut NSString = get_scalar::<*mut c_void>(object, selector)? as *mut NSString; + let s: Retained = Retained::from_raw(raw)?; + Some(s.to_string()) +} diff --git a/src/audio/mod.rs b/src/audio/mod.rs new file mode 100644 index 0000000..449e3b1 --- /dev/null +++ b/src/audio/mod.rs @@ -0,0 +1,175 @@ +//! Platform-neutral audio control. +//! +//! Every OS backend implements [`AudioController`]; nothing outside `src/audio/` +//! knows which one is active. Backends are created *on the audio worker thread* +//! (see [`worker`]) so they may hold thread-affine handles (COM objects, the +//! PulseAudio mainloop, CoreAudio taps) without being `Send`. +//! +//! | OS | Mechanism | Per-app volume | Per-app mute | +//! |---------|---------------------------------------------|----------------|--------------| +//! | Windows | WASAPI `IAudioSessionManager2` sessions | yes | yes | +//! | Linux | PulseAudio / PipeWire-pulse sink inputs | yes | yes | +//! | macOS | Core Audio process taps (macOS 14.2+) | **no** | yes | +//! +//! macOS has no public API for setting another process's volume. HushKey mutes an +//! app by creating a *muted process tap* on it, which silences that process while +//! the tap exists. Arbitrary volume levels are not possible — the backend reports +//! `per_app_volume: false` and the UI hides volume levels instead of faking them. + +mod mute; +pub mod worker; + +#[cfg(target_os = "linux")] +mod linux; +#[cfg(target_os = "macos")] +mod macos; +#[cfg(any(test, not(any(target_os = "windows", target_os = "macos", target_os = "linux"))))] +mod null; +#[cfg(target_os = "windows")] +mod windows; + +pub use mute::MuteManager; + +use std::fmt; +use std::path::PathBuf; + +/// Stable identifier for an application across restarts — *not* a PID. +/// +/// - Windows: lower-cased executable file name (`spotify.exe`), or `system-sounds`. +/// - Linux: `application.process.binary` (`firefox`), falling back to `application.name`. +/// - macOS: bundle identifier (`com.spotify.client`), falling back to executable name. +/// +/// All audio sessions/streams sharing a key are controlled together (e.g. every +/// Chrome tab), which is what users expect from "mute Chrome". +pub type AppKey = String; + +#[derive(Debug, Clone, PartialEq)] +pub struct AudioApp { + pub key: AppKey, + /// Friendly name (`Spotify`, `Google Chrome`). + pub name: String, + pub pids: Vec, + /// 0.0..=1.0, averaged across sessions. `None` if the backend can't read it. + pub volume: Option, + /// `true` only if *every* session of this app is muted. + pub muted: bool, + /// Executable path for icon lookup, when known. + pub exe_path: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Capabilities { + pub per_app_volume: bool, + pub per_app_mute: bool, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum AudioError { + /// No running app has this key right now. + NotRunning(AppKey), + /// The platform can't do this (see the capability table above). + #[cfg_attr(not(target_os = "macos"), allow(dead_code))] + Unsupported(&'static str), + /// The OS needs a permission the user hasn't granted (macOS audio capture). + #[cfg_attr(not(target_os = "macos"), allow(dead_code))] + PermissionDenied(String), + Backend(String), +} + +impl fmt::Display for AudioError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + AudioError::NotRunning(k) => write!(f, "{k} isn't running"), + AudioError::Unsupported(what) => write!(f, "not supported on this platform: {what}"), + AudioError::PermissionDenied(m) => write!(f, "permission needed: {m}"), + AudioError::Backend(m) => write!(f, "{m}"), + } + } +} + +impl std::error::Error for AudioError {} + +pub type AudioResult = Result; + +/// RGBA8 icon pixels (premultiplied: no), row-major. +#[derive(Debug, Clone)] +pub struct IconData { + pub width: u32, + pub height: u32, + pub rgba: Vec, +} + +/// What was muted by a `mute_all` call, so `restore_all` only undoes HushKey's own work +/// and leaves apps the user had muted beforehand alone. +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct MuteSnapshot { + pub muted_keys: Vec, +} + +pub trait AudioController { + fn backend_name(&self) -> &'static str; + + fn capabilities(&self) -> Capabilities; + + /// Every app with an audio session/stream registered with the OS mixer — including + /// idle ones that aren't currently producing sound. One entry per [`AppKey`]. + fn list_audio_apps(&mut self) -> AudioResult>; + + /// Set the volume of every session of `app` (0.0..=1.0). + /// Part of the backend contract (and `--list` diagnostics); the UI currently toggles + /// mute only, which preserves the user's own level in the OS mixer. + #[allow(dead_code)] + fn set_app_volume(&mut self, app: &str, volume: f32) -> AudioResult<()>; + + /// Mute/unmute every session of `app`. Uses the OS mixer's own mute flag, so the + /// user's volume level is preserved by the OS itself — nothing is lost if HushKey + /// crashes while an app is muted. + fn set_app_mute(&mut self, app: &str, muted: bool) -> AudioResult<()>; + + /// Mute every app that isn't already muted. + fn mute_all(&mut self) -> AudioResult { + let mut snap = MuteSnapshot::default(); + for app in self.list_audio_apps()? { + if !app.muted { + match self.set_app_mute(&app.key, true) { + Ok(()) => snap.muted_keys.push(app.key), + Err(e) => log::warn!("mute_all: {}: {e}", app.key), + } + } + } + Ok(snap) + } + + /// Undo a [`mute_all`](Self::mute_all). Apps that have since exited are skipped. + fn restore_all(&mut self, snapshot: &MuteSnapshot) -> AudioResult<()> { + for key in &snapshot.muted_keys { + match self.set_app_mute(key, false) { + Ok(()) | Err(AudioError::NotRunning(_)) => {} + Err(e) => log::warn!("restore_all: {key}: {e}"), + } + } + Ok(()) + } + + /// Best-effort app icon. Default: none (UI shows a letter avatar). + fn app_icon(&mut self, _app: &AudioApp) -> Option { + None + } + + /// Short note for the UI about platform limitations, if any. + fn platform_note(&self) -> Option<&'static str> { + None + } +} + +/// Create the backend for the current OS. Must be called on the thread that will use it. +pub fn create_controller() -> AudioResult> { + #[cfg(target_os = "windows")] + return Ok(Box::new(windows::WasapiController::new()?)); + #[cfg(target_os = "macos")] + return Ok(Box::new(macos::CoreAudioTapController::new()?)); + #[cfg(target_os = "linux")] + return Ok(Box::new(linux::PulseController::new()?)); + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))] + return Ok(Box::new(null::NullController::default())); +} diff --git a/src/audio/mute.rs b/src/audio/mute.rs new file mode 100644 index 0000000..3362e97 --- /dev/null +++ b/src/audio/mute.rs @@ -0,0 +1,147 @@ +//! Toggle / mute-all state machine, independent of any OS backend. + +use super::{AudioController, AudioError, AudioResult, MuteSnapshot}; + +/// Result of a toggle, for feedback (toast / tray flash). +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ToggleOutcome { + pub key: String, + pub name: String, + pub muted: bool, +} + +#[derive(Default)] +pub struct MuteManager { + /// Present while "Mute All" is engaged. + all: Option, +} + +impl MuteManager { + pub fn all_muted(&self) -> bool { + self.all.is_some() + } + + /// Toggle one app: if any of its sessions is audible, mute them all; otherwise unmute. + pub fn toggle_app(&mut self, ctl: &mut dyn AudioController, key: &str) -> AudioResult { + let app = ctl + .list_audio_apps()? + .into_iter() + .find(|a| a.key == key) + .ok_or_else(|| AudioError::NotRunning(key.into()))?; + let mute = !app.muted; + ctl.set_app_mute(key, mute)?; + // If the user manually unmutes an app during Mute All, Restore All must not touch it + // again; if they manually mute it, it was their choice, so restore leaves it muted. + if let Some(snap) = &mut self.all { + snap.muted_keys.retain(|k| k != key); + } + Ok(ToggleOutcome { key: app.key, name: app.name, muted: mute }) + } + + pub fn mute_all(&mut self, ctl: &mut dyn AudioController) -> AudioResult<()> { + let snap = ctl.mute_all()?; + match &mut self.all { + // Already engaged (e.g. re-applied after new apps appeared): extend the snapshot. + Some(existing) => { + for k in snap.muted_keys { + if !existing.muted_keys.contains(&k) { + existing.muted_keys.push(k); + } + } + } + None => self.all = Some(snap), + } + Ok(()) + } + + pub fn restore_all(&mut self, ctl: &mut dyn AudioController) -> AudioResult<()> { + if let Some(snap) = self.all.take() { + ctl.restore_all(&snap)?; + } + Ok(()) + } + + /// Returns the new "all muted" state. + pub fn toggle_all(&mut self, ctl: &mut dyn AudioController) -> AudioResult { + if self.all_muted() { + self.restore_all(ctl)?; + } else { + self.mute_all(ctl)?; + } + Ok(self.all_muted()) + } + + /// While Mute All is engaged, silence apps that started playing afterwards. + pub fn enforce(&mut self, ctl: &mut dyn AudioController) -> AudioResult<()> { + if self.all_muted() { + self.mute_all(ctl)?; + } + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::audio::null::NullController; + + #[test] + fn toggle_flips_state() { + let mut ctl = NullController::with_apps(&[("a", false)]); + let mut m = MuteManager::default(); + assert!(m.toggle_app(&mut ctl, "a").unwrap().muted); + assert_eq!(ctl.is_muted("a"), Some(true)); + assert!(!m.toggle_app(&mut ctl, "a").unwrap().muted); + assert_eq!(ctl.is_muted("a"), Some(false)); + } + + #[test] + fn toggle_missing_app_is_not_running() { + let mut ctl = NullController::with_apps(&[]); + let err = MuteManager::default().toggle_app(&mut ctl, "ghost").unwrap_err(); + assert_eq!(err, AudioError::NotRunning("ghost".into())); + } + + #[test] + fn restore_all_leaves_previously_muted_apps_muted() { + let mut ctl = NullController::with_apps(&[("a", false), ("b", true)]); + let mut m = MuteManager::default(); + assert!(m.toggle_all(&mut ctl).unwrap()); + assert_eq!(ctl.is_muted("a"), Some(true)); + assert!(!m.toggle_all(&mut ctl).unwrap()); + assert_eq!(ctl.is_muted("a"), Some(false)); + assert_eq!(ctl.is_muted("b"), Some(true), "user had muted b before; keep it muted"); + } + + #[test] + fn manual_toggle_during_mute_all_is_respected() { + let mut ctl = NullController::with_apps(&[("a", false), ("b", false)]); + let mut m = MuteManager::default(); + m.mute_all(&mut ctl).unwrap(); + m.toggle_app(&mut ctl, "a").unwrap(); // user unmutes a + m.toggle_app(&mut ctl, "a").unwrap(); // ...and mutes it again manually + m.restore_all(&mut ctl).unwrap(); + assert_eq!(ctl.is_muted("a"), Some(true)); + assert_eq!(ctl.is_muted("b"), Some(false)); + } + + #[test] + fn enforce_mutes_late_starters_and_restores_them() { + let mut ctl = NullController::with_apps(&[("a", false)]); + let mut m = MuteManager::default(); + m.mute_all(&mut ctl).unwrap(); + ctl.apps.extend(NullController::with_apps(&[("late", false)]).apps); + m.enforce(&mut ctl).unwrap(); + assert_eq!(ctl.is_muted("late"), Some(true)); + m.restore_all(&mut ctl).unwrap(); + assert_eq!(ctl.is_muted("late"), Some(false)); + assert_eq!(ctl.is_muted("a"), Some(false)); + } + + #[test] + fn enforce_is_noop_when_not_engaged() { + let mut ctl = NullController::with_apps(&[("a", false)]); + MuteManager::default().enforce(&mut ctl).unwrap(); + assert_eq!(ctl.mute_calls, 0); + } +} diff --git a/src/audio/null.rs b/src/audio/null.rs new file mode 100644 index 0000000..fa98047 --- /dev/null +++ b/src/audio/null.rs @@ -0,0 +1,65 @@ +//! In-memory backend: used by unit tests and as the fallback on unsupported OSes. + +use super::{AudioApp, AudioController, AudioError, AudioResult, Capabilities}; + +#[derive(Default)] +pub struct NullController { + pub apps: Vec, + /// Count of set_app_mute calls, for tests. + pub mute_calls: usize, +} + +impl NullController { + #[cfg(test)] + pub fn with_apps(keys: &[(&str, bool)]) -> Self { + Self { + apps: keys + .iter() + .map(|(k, muted)| AudioApp { + key: (*k).into(), + name: (*k).into(), + pids: vec![1], + volume: Some(1.0), + muted: *muted, + exe_path: None, + }) + .collect(), + mute_calls: 0, + } + } + + pub fn is_muted(&self, key: &str) -> Option { + self.apps.iter().find(|a| a.key == key).map(|a| a.muted) + } +} + +impl AudioController for NullController { + fn backend_name(&self) -> &'static str { + "none" + } + + fn capabilities(&self) -> Capabilities { + Capabilities { per_app_volume: true, per_app_mute: true } + } + + fn list_audio_apps(&mut self) -> AudioResult> { + Ok(self.apps.clone()) + } + + fn set_app_volume(&mut self, app: &str, volume: f32) -> AudioResult<()> { + let a = self.apps.iter_mut().find(|a| a.key == app).ok_or_else(|| AudioError::NotRunning(app.into()))?; + a.volume = Some(volume.clamp(0.0, 1.0)); + Ok(()) + } + + fn set_app_mute(&mut self, app: &str, muted: bool) -> AudioResult<()> { + self.mute_calls += 1; + let a = self.apps.iter_mut().find(|a| a.key == app).ok_or_else(|| AudioError::NotRunning(app.into()))?; + a.muted = muted; + Ok(()) + } + + fn platform_note(&self) -> Option<&'static str> { + Some("Per-app audio control isn't available on this platform.") + } +} diff --git a/src/audio/windows.rs b/src/audio/windows.rs new file mode 100644 index 0000000..b727be8 --- /dev/null +++ b/src/audio/windows.rs @@ -0,0 +1,339 @@ +//! Windows backend: WASAPI audio sessions. +//! +//! Each app that opens an audio stream gets an *audio session* per output device +//! (the same thing the Windows Volume Mixer shows). We enumerate sessions on **every +//! active render device**, not just the default one, so apps routed to headphones +//! or a virtual device are found too. Sessions are grouped by executable name. +//! +//! Full per-app volume and mute are natively supported (`ISimpleAudioVolume`). +//! Threading: this type must stay on the thread that created it (COM MTA init). + +use super::{AudioApp, AudioController, AudioError, AudioResult, Capabilities, IconData}; +use std::collections::{BTreeMap, HashMap}; +use std::ffi::c_void; +use std::os::windows::ffi::OsStrExt; +use std::path::{Path, PathBuf}; + +use windows::core::{Interface, HSTRING, PCWSTR, PWSTR}; +use windows::Win32::Foundation::{CloseHandle, S_OK}; +use windows::Win32::Graphics::Gdi::{ + DeleteObject, GetDC, GetDIBits, GetObjectW, ReleaseDC, BITMAP, BITMAPINFO, BITMAPINFOHEADER, BI_RGB, DIB_RGB_COLORS, +}; +use windows::Win32::Media::Audio::{ + eRender, AudioSessionStateExpired, IAudioSessionControl2, IAudioSessionManager2, IMMDeviceEnumerator, + ISimpleAudioVolume, MMDeviceEnumerator, DEVICE_STATE_ACTIVE, +}; +use windows::Win32::Storage::FileSystem::{GetFileVersionInfoSizeW, GetFileVersionInfoW, VerQueryValueW}; +use windows::Win32::System::Com::{CoCreateInstance, CoInitializeEx, CoUninitialize, CLSCTX_ALL, COINIT_MULTITHREADED}; +use windows::Win32::System::Threading::{ + OpenProcess, QueryFullProcessImageNameW, PROCESS_NAME_WIN32, PROCESS_QUERY_LIMITED_INFORMATION, +}; +use windows::Win32::UI::Shell::SHDefExtractIconW; +use windows::Win32::UI::WindowsAndMessaging::{DestroyIcon, GetIconInfo, HICON, ICONINFO}; + +const SYSTEM_SOUNDS_KEY: &str = "system-sounds"; +const ICON_SIZE: u32 = 64; + +fn err(context: &str, e: windows::core::Error) -> AudioError { + AudioError::Backend(format!("{context}: {e}")) +} + +#[derive(Clone)] +struct ProcInfo { + key: String, + name: String, + path: Option, +} + +struct Session { + key: String, + pid: u32, + volume: ISimpleAudioVolume, +} + +/// Balances `CoInitializeEx`. Declared as the *last* field so COM objects are released first. +struct ComGuard; +impl Drop for ComGuard { + fn drop(&mut self) { + unsafe { CoUninitialize() }; + } +} + +pub struct WasapiController { + enumerator: IMMDeviceEnumerator, + procs: HashMap, + _com: ComGuard, +} + +impl WasapiController { + pub fn new() -> AudioResult { + unsafe { + CoInitializeEx(None, COINIT_MULTITHREADED).ok().map_err(|e| err("CoInitializeEx", e))?; + let guard = ComGuard; + let enumerator: IMMDeviceEnumerator = + CoCreateInstance(&MMDeviceEnumerator, None, CLSCTX_ALL).map_err(|e| err("MMDeviceEnumerator", e))?; + Ok(Self { enumerator, procs: HashMap::new(), _com: guard }) + } + } + + fn proc_info(&mut self, pid: u32) -> ProcInfo { + if let Some(p) = self.procs.get(&pid) { + return p.clone(); + } + if self.procs.len() > 512 { + self.procs.clear(); // PIDs get reused; keep the cache from growing forever. + } + let info = match process_path(pid) { + Some(path) => { + let file = path.file_name().map(|f| f.to_string_lossy().to_lowercase()).unwrap_or_default(); + let name = file_description(&path).unwrap_or_else(|| pretty_stem(&path)); + ProcInfo { key: file, name, path: Some(path) } + } + // Protected/elevated processes we can't open: still controllable by PID. + None => ProcInfo { key: format!("pid-{pid}"), name: format!("Process {pid}"), path: None }, + }; + self.procs.insert(pid, info.clone()); + info + } + + /// Every live audio session on every active output device. + fn sessions(&mut self) -> AudioResult> { + let mut out = Vec::new(); + unsafe { + let devices = self + .enumerator + .EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE) + .map_err(|e| err("EnumAudioEndpoints", e))?; + let count = devices.GetCount().map_err(|e| err("GetCount", e))?; + for i in 0..count { + let Ok(device) = devices.Item(i) else { continue }; + let Ok(manager) = device.Activate::(CLSCTX_ALL, None) else { continue }; + let Ok(list) = manager.GetSessionEnumerator() else { continue }; + let n = list.GetCount().unwrap_or(0); + for j in 0..n { + let Ok(control) = list.GetSession(j) else { continue }; + if control.GetState().map(|s| s == AudioSessionStateExpired).unwrap_or(true) { + continue; + } + let Ok(control2) = control.cast::() else { continue }; + let Ok(volume) = control.cast::() else { continue }; + let pid = control2.GetProcessId().unwrap_or(0); + let key = if control2.IsSystemSoundsSession() == S_OK || pid == 0 { + SYSTEM_SOUNDS_KEY.to_owned() + } else { + self.proc_info(pid).key + }; + out.push(Session { key, pid, volume }); + } + } + } + Ok(out) + } + + fn for_each_session_of( + &mut self, + app: &str, + f: impl Fn(&ISimpleAudioVolume) -> windows::core::Result<()>, + ) -> AudioResult<()> { + let sessions = self.sessions()?; + let mut found = false; + let mut last_err = None; + for s in sessions.iter().filter(|s| s.key == app) { + found = true; + if let Err(e) = f(&s.volume) { + last_err = Some(e); + } + } + if !found { + return Err(AudioError::NotRunning(app.to_owned())); + } + match last_err { + Some(e) => Err(err(app, e)), + None => Ok(()), + } + } +} + +impl AudioController for WasapiController { + fn backend_name(&self) -> &'static str { + "Windows Core Audio (WASAPI)" + } + + fn capabilities(&self) -> Capabilities { + Capabilities { per_app_volume: true, per_app_mute: true } + } + + fn list_audio_apps(&mut self) -> AudioResult> { + let sessions = self.sessions()?; + // key -> (pids, volumes, all_muted) + let mut grouped: BTreeMap, Vec, bool)> = BTreeMap::new(); + for s in &sessions { + let (vol, muted) = unsafe { + (s.volume.GetMasterVolume().unwrap_or(1.0), s.volume.GetMute().map(|b| b.as_bool()).unwrap_or(false)) + }; + let e = grouped.entry(s.key.clone()).or_insert_with(|| (Vec::new(), Vec::new(), true)); + if !e.0.contains(&s.pid) { + e.0.push(s.pid); + } + e.1.push(vol); + e.2 &= muted; + } + let mut apps: Vec = grouped + .into_iter() + .map(|(key, (pids, vols, muted))| { + let (name, exe_path) = if key == SYSTEM_SOUNDS_KEY { + ("System Sounds".to_owned(), None) + } else { + let info = pids.iter().find_map(|p| self.procs.get(p)).cloned(); + info.map(|i| (i.name, i.path)).unwrap_or_else(|| (key.clone(), None)) + }; + let volume = Some(vols.iter().sum::() / vols.len().max(1) as f32); + AudioApp { key, name, pids, volume, muted, exe_path } + }) + .collect(); + apps.sort_by_key(|a| a.name.to_lowercase()); + Ok(apps) + } + + fn set_app_volume(&mut self, app: &str, volume: f32) -> AudioResult<()> { + let v = volume.clamp(0.0, 1.0); + self.for_each_session_of(app, |s| unsafe { s.SetMasterVolume(v, std::ptr::null()) }) + } + + fn set_app_mute(&mut self, app: &str, muted: bool) -> AudioResult<()> { + self.for_each_session_of(app, |s| unsafe { s.SetMute(muted, std::ptr::null()) }) + } + + fn app_icon(&mut self, app: &AudioApp) -> Option { + exe_icon(app.exe_path.as_deref()?) + } +} + +fn wide(path: &Path) -> Vec { + path.as_os_str().encode_wide().chain(std::iter::once(0)).collect() +} + +fn process_path(pid: u32) -> Option { + unsafe { + let handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, false, pid).ok()?; + let mut buf = [0u16; 1024]; + let mut len = buf.len() as u32; + let ok = QueryFullProcessImageNameW(handle, PROCESS_NAME_WIN32, PWSTR(buf.as_mut_ptr()), &mut len); + let _ = CloseHandle(handle); + ok.ok()?; + Some(PathBuf::from(String::from_utf16_lossy(&buf[..len as usize]))) + } +} + +fn pretty_stem(path: &Path) -> String { + let stem = path.file_stem().map(|s| s.to_string_lossy().into_owned()).unwrap_or_default(); + let mut c = stem.chars(); + match c.next() { + Some(f) => f.to_uppercase().chain(c).collect(), + None => stem, + } +} + +/// `FileDescription` from the exe's version resource ("Spotify", "Google Chrome"). +fn file_description(path: &Path) -> Option { + let w = wide(path); + unsafe { + let size = GetFileVersionInfoSizeW(PCWSTR(w.as_ptr()), None); + if size == 0 { + return None; + } + let mut data = vec![0u8; size as usize]; + GetFileVersionInfoW(PCWSTR(w.as_ptr()), None, size, data.as_mut_ptr() as *mut c_void).ok()?; + + let mut ptr: *mut c_void = std::ptr::null_mut(); + let mut len = 0u32; + if !VerQueryValueW( + data.as_ptr() as *const c_void, + &HSTRING::from("\\VarFileInfo\\Translation"), + &mut ptr, + &mut len, + ) + .as_bool() + || len < 4 + { + return None; + } + let lang = *(ptr as *const u16); + let codepage = *(ptr as *const u16).add(1); + let sub = HSTRING::from(format!("\\StringFileInfo\\{lang:04x}{codepage:04x}\\FileDescription")); + if !VerQueryValueW(data.as_ptr() as *const c_void, &sub, &mut ptr, &mut len).as_bool() || len == 0 { + return None; + } + let chars = std::slice::from_raw_parts(ptr as *const u16, len as usize); + let s = String::from_utf16_lossy(chars).trim_end_matches('\0').trim().to_owned(); + (!s.is_empty()).then_some(s) + } +} + +fn exe_icon(path: &Path) -> Option { + let w = wide(path); + unsafe { + let mut icon = HICON::default(); + SHDefExtractIconW(PCWSTR(w.as_ptr()), 0, 0, Some(&mut icon), None, ICON_SIZE).ok().ok()?; + if icon.is_invalid() { + return None; + } + let data = hicon_to_rgba(icon); + let _ = DestroyIcon(icon); + data + } +} + +unsafe fn hicon_to_rgba(icon: HICON) -> Option { + let mut info = ICONINFO::default(); + GetIconInfo(icon, &mut info).ok()?; + let cleanup = |info: &ICONINFO| { + if !info.hbmColor.is_invalid() { + let _ = DeleteObject(info.hbmColor.into()); + } + if !info.hbmMask.is_invalid() { + let _ = DeleteObject(info.hbmMask.into()); + } + }; + if info.hbmColor.is_invalid() { + cleanup(&info); + return None; // monochrome icon; letter avatar looks better anyway + } + let mut bmp = BITMAP::default(); + if GetObjectW(info.hbmColor.into(), std::mem::size_of::() as i32, Some(&mut bmp as *mut _ as *mut c_void)) + == 0 + { + cleanup(&info); + return None; + } + let (w, h) = (bmp.bmWidth, bmp.bmHeight); + let mut bi = BITMAPINFO { + bmiHeader: BITMAPINFOHEADER { + biSize: std::mem::size_of::() as u32, + biWidth: w, + biHeight: -h, // top-down + biPlanes: 1, + biBitCount: 32, + biCompression: BI_RGB.0, + ..Default::default() + }, + ..Default::default() + }; + let mut buf = vec![0u8; (w * h * 4) as usize]; + let dc = GetDC(None); + let lines = + GetDIBits(dc, info.hbmColor, 0, h as u32, Some(buf.as_mut_ptr() as *mut c_void), &mut bi, DIB_RGB_COLORS); + ReleaseDC(None, dc); + cleanup(&info); + if lines == 0 { + return None; + } + let has_alpha = buf.chunks_exact(4).any(|p| p[3] != 0); + for px in buf.chunks_exact_mut(4) { + px.swap(0, 2); // BGRA -> RGBA + if !has_alpha { + px[3] = 255; + } + } + Some(IconData { width: w as u32, height: h as u32, rgba: buf }) +} diff --git a/src/audio/worker.rs b/src/audio/worker.rs new file mode 100644 index 0000000..baa3a69 --- /dev/null +++ b/src/audio/worker.rs @@ -0,0 +1,190 @@ +//! Dedicated audio thread. +//! +//! The backend lives entirely on this thread; everyone else talks to it through +//! [`AudioHandle`] (commands in) and an event sink (events out). Hotkey presses go +//! straight here from the OS hotkey callback, so muting never waits on the UI. +//! +//! The thread blocks on its channel when idle — zero CPU. The only periodic work is +//! while "Mute All" is engaged: every 2 s it silences apps that started afterwards. + +use super::mute::ToggleOutcome; +use super::{create_controller, AudioApp, AudioError, Capabilities, IconData, MuteManager}; +use std::collections::HashSet; +use std::sync::mpsc::{self, RecvTimeoutError, Sender}; +use std::thread::JoinHandle; +use std::time::Duration; + +const ENFORCE_INTERVAL: Duration = Duration::from_secs(2); + +#[derive(Debug, Clone)] +pub enum AudioCommand { + Refresh, + /// `from_hotkey` controls whether the user gets toast/tray feedback. + ToggleApp { + key: String, + from_hotkey: bool, + }, + ToggleAll { + from_hotkey: bool, + }, + RestoreAll { + from_hotkey: bool, + }, + Shutdown, +} + +#[derive(Debug, Clone)] +pub enum AudioEvent { + Ready { + backend: &'static str, + caps: Capabilities, + note: Option<&'static str>, + }, + Apps(Vec), + Icon { + key: String, + icon: IconData, + }, + Toggled { + outcome: ToggleOutcome, + from_hotkey: bool, + }, + AllMuted { + muted: bool, + from_hotkey: bool, + }, + /// A per-app shortcut fired but that app has no audio session right now. + NotRunning { + key: String, + from_hotkey: bool, + }, + Error { + message: String, + from_hotkey: bool, + }, + /// The backend couldn't start at all (e.g. no PulseAudio server). + Fatal(String), +} + +pub struct AudioHandle { + tx: Sender, + thread: Option>, +} + +impl AudioHandle { + pub fn sender(&self) -> Sender { + self.tx.clone() + } + + pub fn send(&self, cmd: AudioCommand) { + let _ = self.tx.send(cmd); + } + + /// Restores anything Mute All silenced, then joins the thread. + pub fn shutdown(mut self) { + let _ = self.tx.send(AudioCommand::Shutdown); + if let Some(t) = self.thread.take() { + let _ = t.join(); + } + } +} + +pub fn spawn(sink: impl Fn(AudioEvent) + Send + 'static) -> AudioHandle { + let (tx, rx) = mpsc::channel::(); + let thread = std::thread::Builder::new() + .name("hushkey-audio".into()) + .spawn(move || { + let mut ctl = match create_controller() { + Ok(c) => c, + Err(e) => { + log::error!("audio backend failed to start: {e}"); + sink(AudioEvent::Fatal(e.to_string())); + // Keep draining so senders never block/err; nothing to control. + while let Ok(cmd) = rx.recv() { + if matches!(cmd, AudioCommand::Shutdown) { + break; + } + } + return; + } + }; + log::info!("audio backend: {}", ctl.backend_name()); + sink(AudioEvent::Ready { + backend: ctl.backend_name(), + caps: ctl.capabilities(), + note: ctl.platform_note(), + }); + + let mut mute = MuteManager::default(); + let mut icons_sent: HashSet = HashSet::new(); + + let publish_apps = + |ctl: &mut dyn super::AudioController, icons_sent: &mut HashSet| match ctl.list_audio_apps() { + Ok(apps) => { + for app in &apps { + if icons_sent.insert(app.key.clone()) { + if let Some(icon) = ctl.app_icon(app) { + sink(AudioEvent::Icon { key: app.key.clone(), icon }); + } + } + } + sink(AudioEvent::Apps(apps)); + } + Err(e) => sink(AudioEvent::Error { message: e.to_string(), from_hotkey: false }), + }; + + loop { + let cmd = if mute.all_muted() { + match rx.recv_timeout(ENFORCE_INTERVAL) { + Ok(cmd) => cmd, + Err(RecvTimeoutError::Timeout) => { + if let Err(e) = mute.enforce(ctl.as_mut()) { + log::debug!("enforce: {e}"); + } + continue; + } + Err(RecvTimeoutError::Disconnected) => AudioCommand::Shutdown, + } + } else { + rx.recv().unwrap_or(AudioCommand::Shutdown) + }; + + match cmd { + AudioCommand::Refresh => { + let _ = mute.enforce(ctl.as_mut()); + publish_apps(ctl.as_mut(), &mut icons_sent); + } + AudioCommand::ToggleApp { key, from_hotkey } => { + match mute.toggle_app(ctl.as_mut(), &key) { + Ok(outcome) => sink(AudioEvent::Toggled { outcome, from_hotkey }), + Err(AudioError::NotRunning(_)) => sink(AudioEvent::NotRunning { key, from_hotkey }), + Err(e) => sink(AudioEvent::Error { message: format!("{key}: {e}"), from_hotkey }), + } + publish_apps(ctl.as_mut(), &mut icons_sent); + } + AudioCommand::ToggleAll { from_hotkey } => { + match mute.toggle_all(ctl.as_mut()) { + Ok(muted) => sink(AudioEvent::AllMuted { muted, from_hotkey }), + Err(e) => sink(AudioEvent::Error { message: e.to_string(), from_hotkey }), + } + publish_apps(ctl.as_mut(), &mut icons_sent); + } + AudioCommand::RestoreAll { from_hotkey } => { + match mute.restore_all(ctl.as_mut()) { + Ok(()) => sink(AudioEvent::AllMuted { muted: false, from_hotkey }), + Err(e) => sink(AudioEvent::Error { message: e.to_string(), from_hotkey }), + } + publish_apps(ctl.as_mut(), &mut icons_sent); + } + AudioCommand::Shutdown => { + if let Err(e) = mute.restore_all(ctl.as_mut()) { + log::warn!("restore on shutdown failed: {e}"); + } + break; + } + } + } + }) + .expect("spawn audio thread"); + AudioHandle { tx, thread: Some(thread) } +} diff --git a/src/config/mod.rs b/src/config/mod.rs new file mode 100644 index 0000000..9f39df5 --- /dev/null +++ b/src/config/mod.rs @@ -0,0 +1,185 @@ +//! Persistent settings + shortcut bindings. +//! +//! Stored as TOML in the OS config dir: +//! - Windows: `%APPDATA%\HushKey\config\config.toml` +//! - macOS: `~/Library/Application Support/HushKey/config.toml` +//! - Linux: `$XDG_CONFIG_HOME/hushkey/config.toml` +//! +//! Writes are atomic (temp file + rename) so a crash never leaves a half-written file. + +use serde::{Deserialize, Serialize}; +use std::fs; +use std::io; +use std::path::{Path, PathBuf}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)] +#[serde(rename_all = "lowercase")] +pub enum Theme { + #[default] + Dark, + Light, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(default)] +pub struct Settings { + pub theme: Theme, + pub launch_on_startup: bool, + pub start_minimized: bool, + /// Show the small on-screen confirmation when a shortcut fires. + pub show_toast: bool, +} + +impl Default for Settings { + fn default() -> Self { + Self { theme: Theme::Dark, launch_on_startup: false, start_minimized: false, show_toast: true } + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] +#[serde(default)] +pub struct MuteAllBinding { + /// Toggles mute-all on/off. Human-readable accelerator, e.g. `"Ctrl+Alt+M"`. + pub hotkey: Option, + /// Optional dedicated "restore everything" shortcut. + pub restore_hotkey: Option, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct AppBinding { + /// Stable app key (see `audio::AppKey`), e.g. `"spotify.exe"`. + pub app: String, + /// Last known friendly name, so bindings for apps that aren't running still read nicely. + #[serde(default)] + pub display_name: String, + pub hotkey: String, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] +#[serde(default)] +pub struct Config { + pub settings: Settings, + pub mute_all: MuteAllBinding, + #[serde(rename = "bindings")] + pub bindings: Vec, +} + +impl Config { + pub fn binding_for(&self, app: &str) -> Option<&AppBinding> { + self.bindings.iter().find(|b| b.app == app) + } + + /// Set (or clear with `None`) the shortcut for an app. + pub fn set_binding(&mut self, app: &str, display_name: &str, hotkey: Option) { + self.bindings.retain(|b| b.app != app); + if let Some(hotkey) = hotkey { + self.bindings.push(AppBinding { app: app.to_owned(), display_name: display_name.to_owned(), hotkey }); + self.bindings.sort_by(|a, b| a.app.cmp(&b.app)); + } + } +} + +pub struct ConfigStore { + path: PathBuf, +} + +impl ConfigStore { + pub fn new(path: PathBuf) -> Self { + Self { path } + } + + /// Store at the platform default location. + pub fn default_location() -> Option { + let dirs = directories::ProjectDirs::from("", "", "HushKey")?; + Some(Self::new(dirs.config_dir().join("config.toml"))) + } + + pub fn path(&self) -> &Path { + &self.path + } + + /// Load the config. A missing file yields defaults; a corrupt file is backed up + /// to `config.toml.bak` and defaults are used, so the app still starts. + pub fn load(&self) -> Config { + match fs::read_to_string(&self.path) { + Ok(text) => match toml::from_str(&text) { + Ok(cfg) => cfg, + Err(e) => { + log::error!("config at {} is invalid ({e}); backing up and using defaults", self.path.display()); + let _ = fs::copy(&self.path, self.path.with_extension("toml.bak")); + Config::default() + } + }, + Err(e) if e.kind() == io::ErrorKind::NotFound => Config::default(), + Err(e) => { + log::error!("cannot read config {}: {e}", self.path.display()); + Config::default() + } + } + } + + pub fn save(&self, cfg: &Config) -> io::Result<()> { + if let Some(dir) = self.path.parent() { + fs::create_dir_all(dir)?; + } + let text = toml::to_string_pretty(cfg).map_err(io::Error::other)?; + let tmp = self.path.with_extension("toml.tmp"); + fs::write(&tmp, text)?; + fs::rename(&tmp, &self.path) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn temp_store(name: &str) -> ConfigStore { + let dir = std::env::temp_dir().join(format!("hushkey-test-{name}-{}", std::process::id())); + let _ = fs::remove_dir_all(&dir); + ConfigStore::new(dir.join("config.toml")) + } + + #[test] + fn missing_file_gives_defaults() { + let store = temp_store("missing"); + assert_eq!(store.load(), Config::default()); + } + + #[test] + fn roundtrip() { + let store = temp_store("roundtrip"); + let mut cfg = Config::default(); + cfg.settings.theme = Theme::Light; + cfg.mute_all.hotkey = Some("Ctrl+Alt+M".into()); + cfg.set_binding("spotify.exe", "Spotify", Some("Ctrl+Alt+S".into())); + store.save(&cfg).unwrap(); + assert_eq!(store.load(), cfg); + } + + #[test] + fn corrupt_file_falls_back_and_backs_up() { + let store = temp_store("corrupt"); + fs::create_dir_all(store.path().parent().unwrap()).unwrap(); + fs::write(store.path(), "this is = = not toml").unwrap(); + assert_eq!(store.load(), Config::default()); + assert!(store.path().with_extension("toml.bak").exists()); + } + + #[test] + fn set_binding_replaces_and_clears() { + let mut cfg = Config::default(); + cfg.set_binding("a.exe", "A", Some("Ctrl+1".into())); + cfg.set_binding("a.exe", "A", Some("Ctrl+2".into())); + assert_eq!(cfg.bindings.len(), 1); + assert_eq!(cfg.binding_for("a.exe").unwrap().hotkey, "Ctrl+2"); + cfg.set_binding("a.exe", "A", None); + assert!(cfg.bindings.is_empty()); + } + + #[test] + fn partial_file_uses_field_defaults() { + let cfg: Config = toml::from_str("[settings]\ntheme = \"light\"\n").unwrap(); + assert_eq!(cfg.settings.theme, Theme::Light); + assert!(cfg.settings.show_toast); + } +} diff --git a/src/hotkeys/accelerator.rs b/src/hotkeys/accelerator.rs new file mode 100644 index 0000000..445f09c --- /dev/null +++ b/src/hotkeys/accelerator.rs @@ -0,0 +1,429 @@ +//! Platform-neutral keyboard shortcut ("accelerator") type. +//! +//! Stored in config as a readable string such as `"Ctrl+Alt+S"` or `"Ctrl+Shift+F9"`. +//! Keys are *physical* key codes (US layout positions), which is what the OS hotkey +//! APIs register — so `Ctrl+Z` on AZERTY is the key physically labelled `W`. + +use global_hotkey::hotkey::{Code, HotKey, Modifiers}; +use std::fmt; +use std::str::FromStr; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct Accelerator { + pub ctrl: bool, + pub alt: bool, + pub shift: bool, + /// Windows key / Command / Super. + pub meta: bool, + pub code: Code, +} + +impl Accelerator { + pub fn new(ctrl: bool, alt: bool, shift: bool, meta: bool, code: Code) -> Self { + Self { ctrl, alt, shift, meta, code } + } + + pub fn to_hotkey(self) -> HotKey { + let mut mods = Modifiers::empty(); + if self.ctrl { + mods |= Modifiers::CONTROL; + } + if self.alt { + mods |= Modifiers::ALT; + } + if self.shift { + mods |= Modifiers::SHIFT; + } + if self.meta { + mods |= Modifiers::META; + } + HotKey::new((!mods.is_empty()).then_some(mods), self.code) + } + + /// Label for the UI, using the platform's name for the meta key. + pub fn label(&self) -> String { + let meta = if cfg!(target_os = "macos") { + "Cmd" + } else if cfg!(target_os = "windows") { + "Win" + } else { + "Super" + }; + let alt = if cfg!(target_os = "macos") { "Option" } else { "Alt" }; + let mut parts: Vec<&str> = Vec::with_capacity(5); + if self.ctrl { + parts.push("Ctrl"); + } + if self.alt { + parts.push(alt); + } + if self.shift { + parts.push("Shift"); + } + if self.meta { + parts.push(meta); + } + let key = key_label(self.code); + parts.push(&key); + parts.join(" + ") + } + + fn has_strong_modifier(&self) -> bool { + self.ctrl || self.alt || self.meta + } +} + +/// Canonical storage form: `Ctrl+Alt+Shift+Meta+`. +impl fmt::Display for Accelerator { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.ctrl { + f.write_str("Ctrl+")?; + } + if self.alt { + f.write_str("Alt+")?; + } + if self.shift { + f.write_str("Shift+")?; + } + if self.meta { + f.write_str("Meta+")?; + } + f.write_str(&key_label(self.code)) + } +} + +#[derive(Debug, PartialEq, Eq)] +pub struct ParseError(pub String); + +impl fmt::Display for ParseError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "invalid shortcut: {}", self.0) + } +} + +impl FromStr for Accelerator { + type Err = ParseError; + + fn from_str(s: &str) -> Result { + let mut acc = Accelerator::new(false, false, false, false, Code::Unidentified); + let mut key = None; + for raw in s.split('+').map(str::trim) { + match raw.to_ascii_lowercase().as_str() { + "ctrl" | "control" => acc.ctrl = true, + "alt" | "option" => acc.alt = true, + "shift" => acc.shift = true, + "meta" | "super" | "win" | "cmd" | "command" => acc.meta = true, + "" => return Err(ParseError(s.to_owned())), + _ => { + if key.is_some() { + return Err(ParseError(s.to_owned())); + } + key = Some(parse_key(raw).ok_or_else(|| ParseError(s.to_owned()))?); + } + } + } + acc.code = key.ok_or_else(|| ParseError(s.to_owned()))?; + Ok(acc) + } +} + +fn parse_key(s: &str) -> Option { + let mut chars = s.chars(); + if let (Some(c), None) = (chars.next(), chars.next()) { + if c.is_ascii_alphabetic() { + return Code::from_str(&format!("Key{}", c.to_ascii_uppercase())).ok(); + } + if c.is_ascii_digit() { + return Code::from_str(&format!("Digit{c}")).ok(); + } + } + match s.to_ascii_lowercase().as_str() { + "up" => return Some(Code::ArrowUp), + "down" => return Some(Code::ArrowDown), + "left" => return Some(Code::ArrowLeft), + "right" => return Some(Code::ArrowRight), + "esc" => return Some(Code::Escape), + "pgup" => return Some(Code::PageUp), + "pgdn" => return Some(Code::PageDown), + _ => {} + } + if let Some(n) = s.strip_prefix("Num").filter(|n| n.len() == 1) { + return Code::from_str(&format!("Numpad{n}")).ok(); + } + Code::from_str(s).ok().filter(|c| *c != Code::Unidentified) +} + +/// Short human label for a key code: `KeyS` → `S`, `Digit1` → `1`, `ArrowUp` → `Up`. +pub fn key_label(code: Code) -> String { + let name = code.to_string(); + if let Some(rest) = name.strip_prefix("Key").filter(|r| r.len() == 1) { + return rest.to_owned(); + } + if let Some(rest) = name.strip_prefix("Digit").filter(|r| r.len() == 1) { + return rest.to_owned(); + } + if let Some(rest) = name.strip_prefix("Arrow") { + return rest.to_owned(); + } + if let Some(rest) = name.strip_prefix("Numpad").filter(|r| r.len() == 1) { + return format!("Num{rest}"); + } + name +} + +/// Outcome of a key press while the UI is in "press a shortcut" mode. +#[derive(Debug, PartialEq, Eq)] +pub enum Capture { + Captured(Accelerator), + /// Escape: leave the binding unchanged. + Cancel, + /// Backspace / Delete with no modifiers: remove the binding. + Clear, + /// A bare modifier press — keep waiting for the real key. + Pending, + Invalid(&'static str), +} + +/// Translate a Slint `KeyEvent` (its `text` plus modifier flags) into a capture result. +pub fn capture_from_key_event(text: &str, ctrl: bool, alt: bool, shift: bool, meta: bool) -> Capture { + use slint::platform::Key; + + let mut chars = text.chars(); + let Some(c) = chars.next() else { return Capture::Pending }; + if chars.next().is_some() { + return Capture::Invalid("That key can't be used as a shortcut"); + } + let no_mods = !(ctrl || alt || shift || meta); + + let is = |k: Key| c == char::from(k); + if is(Key::Escape) { + return Capture::Cancel; + } + if (is(Key::Backspace) || is(Key::Delete)) && no_mods { + return Capture::Clear; + } + let modifier_keys = [ + Key::Shift, + Key::ShiftR, + Key::Control, + Key::ControlR, + Key::Alt, + Key::AltGr, + Key::Meta, + Key::MetaR, + Key::CapsLock, + ]; + if modifier_keys.iter().any(|k| is(*k)) { + return Capture::Pending; + } + + let special: &[(Key, Code)] = &[ + (Key::Backspace, Code::Backspace), + (Key::Delete, Code::Delete), + (Key::Tab, Code::Tab), + (Key::Return, Code::Enter), + (Key::Space, Code::Space), + (Key::UpArrow, Code::ArrowUp), + (Key::DownArrow, Code::ArrowDown), + (Key::LeftArrow, Code::ArrowLeft), + (Key::RightArrow, Code::ArrowRight), + (Key::Insert, Code::Insert), + (Key::Home, Code::Home), + (Key::End, Code::End), + (Key::PageUp, Code::PageUp), + (Key::PageDown, Code::PageDown), + (Key::Pause, Code::Pause), + (Key::ScrollLock, Code::ScrollLock), + (Key::F1, Code::F1), + (Key::F2, Code::F2), + (Key::F3, Code::F3), + (Key::F4, Code::F4), + (Key::F5, Code::F5), + (Key::F6, Code::F6), + (Key::F7, Code::F7), + (Key::F8, Code::F8), + (Key::F9, Code::F9), + (Key::F10, Code::F10), + (Key::F11, Code::F11), + (Key::F12, Code::F12), + (Key::F13, Code::F13), + (Key::F14, Code::F14), + (Key::F15, Code::F15), + (Key::F16, Code::F16), + (Key::F17, Code::F17), + (Key::F18, Code::F18), + (Key::F19, Code::F19), + (Key::F20, Code::F20), + (Key::F21, Code::F21), + (Key::F22, Code::F22), + (Key::F23, Code::F23), + (Key::F24, Code::F24), + ]; + let code = special.iter().find(|(k, _)| is(*k)).map(|(_, code)| *code).or_else(|| printable_to_code(c)); + + let Some(code) = code else { + return Capture::Invalid("That key can't be used as a shortcut"); + }; + let acc = Accelerator::new(ctrl, alt, shift, meta, code); + + // Keys that can stand alone without hijacking normal typing. + let standalone = matches!( + code, + Code::F1 + | Code::F2 + | Code::F3 + | Code::F4 + | Code::F5 + | Code::F6 + | Code::F7 + | Code::F8 + | Code::F9 + | Code::F10 + | Code::F11 + | Code::F12 + | Code::F13 + | Code::F14 + | Code::F15 + | Code::F16 + | Code::F17 + | Code::F18 + | Code::F19 + | Code::F20 + | Code::F21 + | Code::F22 + | Code::F23 + | Code::F24 + | Code::Pause + | Code::ScrollLock + | Code::Insert + ); + if !standalone && !acc.has_strong_modifier() { + return Capture::Invalid("Add Ctrl, Alt or Win/Cmd so normal typing isn't hijacked"); + } + Capture::Captured(acc) +} + +/// Map a printable character (US layout) to its physical key code. +fn printable_to_code(c: char) -> Option { + // Note: Slint reports Ctrl+S as text "s" (it reserves ASCII control chars for its + // own special keys, e.g. U+0013 is AltGr), so no control-char translation is needed. + if c.is_ascii_alphabetic() || c.is_ascii_digit() { + return parse_key(&c.to_string()); + } + Some(match c { + ' ' => Code::Space, + '-' | '_' => Code::Minus, + '=' | '+' => Code::Equal, + '[' | '{' => Code::BracketLeft, + ']' | '}' => Code::BracketRight, + '\\' | '|' => Code::Backslash, + ';' | ':' => Code::Semicolon, + '\'' | '"' => Code::Quote, + ',' | '<' => Code::Comma, + '.' | '>' => Code::Period, + '/' | '?' => Code::Slash, + '`' | '~' => Code::Backquote, + '!' => Code::Digit1, + '@' => Code::Digit2, + '#' => Code::Digit3, + '$' => Code::Digit4, + '%' => Code::Digit5, + '^' => Code::Digit6, + '&' => Code::Digit7, + '*' => Code::Digit8, + '(' => Code::Digit9, + ')' => Code::Digit0, + _ => return None, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use slint::platform::Key; + + #[test] + fn parse_and_display_roundtrip() { + for s in ["Ctrl+Alt+S", "Ctrl+Shift+F9", "Alt+Meta+1", "F13", "Ctrl+Alt+Up", "Ctrl+Num5", "Ctrl+Alt+Minus"] { + let acc: Accelerator = s.parse().unwrap(); + assert_eq!(acc.to_string(), s, "roundtrip of {s}"); + } + } + + #[test] + fn parse_is_lenient() { + let a: Accelerator = "control + option + KeyS".parse().unwrap(); + assert_eq!(a, Accelerator::new(true, true, false, false, Code::KeyS)); + let b: Accelerator = "cmd+shift+m".parse().unwrap(); + assert_eq!(b, Accelerator::new(false, false, true, true, Code::KeyM)); + } + + #[test] + fn parse_rejects_garbage() { + assert!("".parse::().is_err()); + assert!("Ctrl+".parse::().is_err()); + assert!("Ctrl+Alt".parse::().is_err()); + assert!("Ctrl+A+B".parse::().is_err()); + assert!("Ctrl+NotAKey".parse::().is_err()); + } + + #[test] + fn capture_letters_need_modifier() { + assert_eq!( + capture_from_key_event("s", true, true, false, false), + Capture::Captured(Accelerator::new(true, true, false, false, Code::KeyS)) + ); + assert!(matches!(capture_from_key_event("s", false, false, false, false), Capture::Invalid(_))); + assert!(matches!(capture_from_key_event("S", false, false, true, false), Capture::Invalid(_))); + } + + #[test] + fn capture_shifted_symbols_map_to_physical_keys() { + assert_eq!( + capture_from_key_event("!", true, false, true, false), + Capture::Captured(Accelerator::new(true, false, true, false, Code::Digit1)) + ); + assert_eq!( + capture_from_key_event("S", true, false, true, false), + Capture::Captured(Accelerator::new(true, false, true, false, Code::KeyS)) + ); + } + + #[test] + fn capture_altgr_is_a_modifier_not_a_key() { + // U+0013 is Slint's AltGr, not Ctrl+S. + assert_eq!(capture_from_key_event("\u{13}", true, false, false, false), Capture::Pending); + } + + #[test] + fn capture_function_keys_alone() { + let f9 = char::from(Key::F9).to_string(); + assert_eq!( + capture_from_key_event(&f9, false, false, false, false), + Capture::Captured(Accelerator::new(false, false, false, false, Code::F9)) + ); + } + + #[test] + fn capture_special_actions() { + assert_eq!( + capture_from_key_event(&char::from(Key::Escape).to_string(), false, false, false, false), + Capture::Cancel + ); + assert_eq!( + capture_from_key_event(&char::from(Key::Backspace).to_string(), false, false, false, false), + Capture::Clear + ); + assert_eq!( + capture_from_key_event(&char::from(Key::Control).to_string(), true, false, false, false), + Capture::Pending + ); + assert_eq!(capture_from_key_event("", false, false, false, false), Capture::Pending); + } + + #[test] + fn label_is_pretty() { + let a: Accelerator = "Ctrl+Shift+Up".parse().unwrap(); + assert_eq!(a.label(), "Ctrl + Shift + Up"); + } +} diff --git a/src/hotkeys/mod.rs b/src/hotkeys/mod.rs new file mode 100644 index 0000000..e138108 --- /dev/null +++ b/src/hotkeys/mod.rs @@ -0,0 +1,122 @@ +//! System-wide hotkey registration. +//! +//! Uses the `global-hotkey` crate: +//! - Windows: `RegisterHotKey` — delivered even while a fullscreen game has focus. +//! - macOS: Carbon `RegisterEventHotKey` — no Accessibility permission required. +//! - Linux: X11 `XGrabKey`. **Wayland has no global-hotkey protocol**; under Wayland +//! shortcuts only work for XWayland clients or via the desktop's own shortcut +//! settings (see docs/design-decisions.md). +//! +//! The manager must be created and used on the main (event-loop) thread. The press +//! handler, however, runs wherever the OS delivers the event and forwards the action +//! straight to the audio worker — no UI round-trip on the hot path. + +mod accelerator; + +pub use accelerator::{capture_from_key_event, Accelerator, Capture}; + +use crate::config::Config; +use global_hotkey::{GlobalHotKeyEvent, GlobalHotKeyManager, HotKeyState}; +use std::collections::HashMap; +use std::sync::{Arc, Mutex}; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum HotkeyAction { + ToggleApp(String), + ToggleAll, + RestoreAll, +} + +type ActionMap = Arc>>; + +pub struct Hotkeys { + manager: GlobalHotKeyManager, + registered: Vec, + actions: ActionMap, +} + +impl Hotkeys { + /// Create the manager and install `on_action`, called on every key *press*. + pub fn new(on_action: impl Fn(HotkeyAction) + Send + Sync + 'static) -> Result { + let manager = GlobalHotKeyManager::new().map_err(|e| e.to_string())?; + let actions: ActionMap = Arc::default(); + let lookup = actions.clone(); + GlobalHotKeyEvent::set_event_handler(Some(move |ev: GlobalHotKeyEvent| { + if ev.state() != HotKeyState::Pressed { + return; + } + let action = lookup.lock().ok().and_then(|m| m.get(&ev.id()).cloned()); + if let Some(action) = action { + on_action(action); + } + })); + Ok(Self { manager, registered: Vec::new(), actions }) + } + + /// Unregister everything (e.g. while the user is recording a new shortcut, so the + /// key combo reaches our window instead of firing the old binding). + pub fn suspend(&mut self) { + if !self.registered.is_empty() { + let _ = self.manager.unregister_all(&self.registered); + self.registered.clear(); + } + if let Ok(mut m) = self.actions.lock() { + m.clear(); + } + } + + /// Re-register every shortcut in `cfg`. Returns human-readable failures + /// (typically "already registered by another program"). + pub fn apply(&mut self, cfg: &Config) -> Vec { + self.suspend(); + let mut wanted: Vec<(String, HotkeyAction, String)> = Vec::new(); + if let Some(h) = &cfg.mute_all.hotkey { + wanted.push((h.clone(), HotkeyAction::ToggleAll, "Mute All".into())); + } + if let Some(h) = &cfg.mute_all.restore_hotkey { + wanted.push((h.clone(), HotkeyAction::RestoreAll, "Restore All".into())); + } + for b in &cfg.bindings { + let label = if b.display_name.is_empty() { b.app.clone() } else { b.display_name.clone() }; + wanted.push((b.hotkey.clone(), HotkeyAction::ToggleApp(b.app.clone()), label)); + } + + let mut errors = Vec::new(); + let mut map = HashMap::new(); + for (text, action, label) in wanted { + let acc = match text.parse::() { + Ok(a) => a, + Err(e) => { + errors.push(format!("{label}: {e}")); + continue; + } + }; + let hk = acc.to_hotkey(); + if map.contains_key(&hk.id()) { + errors.push(format!("{label}: {} is already used by another binding", acc.label())); + continue; + } + match self.manager.register(hk) { + Ok(()) => { + self.registered.push(hk); + map.insert(hk.id(), action); + } + Err(e) => { + log::warn!("register {text} failed: {e}"); + errors.push(format!("{label}: {} is taken by another program", acc.label())); + } + } + } + if let Ok(mut m) = self.actions.lock() { + *m = map; + } + errors + } +} + +impl Drop for Hotkeys { + fn drop(&mut self) { + self.suspend(); + GlobalHotKeyEvent::set_event_handler(None::); + } +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..fae3a0c --- /dev/null +++ b/src/main.rs @@ -0,0 +1,114 @@ +// No console window on Windows release builds. +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +//! HushKey — global hotkeys to mute individual apps, or everything at once. +//! +//! Module map (see docs/architecture.md): +//! - `audio` platform-neutral `AudioController` trait + per-OS backends + worker thread +//! - `hotkeys` accelerator parsing/capture + global registration +//! - `config` TOML persistence +//! - `ui` Slint components, tray, toast, procedural icon +//! - `app` main-thread controller wiring it all together +//! - `platform` launch-at-login, single instance, open-folder + +mod app; +mod audio; +mod config; +mod hotkeys; +mod platform; +mod ui; + +slint::include_modules!(); + +fn main() { + env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("hushkey=info")).init(); + + let args: Vec = std::env::args().skip(1).collect(); + if args.iter().any(|a| a == "--list") { + list_apps(); + return; + } + if args.iter().any(|a| a == "--help" || a == "-h") { + println!( + "HushKey {}\n\n --minimized start in the tray\n --list print detected audio apps and exit", + env!("CARGO_PKG_VERSION") + ); + return; + } + + let listener = match platform::acquire_single_instance() { + platform::Instance::AlreadyRunning => { + log::info!("HushKey is already running; asked it to show its window"); + return; + } + platform::Instance::Primary(l) => Some(l), + platform::Instance::Unguarded => { + log::warn!("single-instance port busy; continuing without the guard"); + None + } + }; + + if let Err(e) = select_backend() { + eprintln!("HushKey: cannot initialise the UI backend: {e}"); + std::process::exit(1); + } + + let start_hidden = args.iter().any(|a| a == platform::MINIMIZED_ARG) || { + let store = config::ConfigStore::default_location(); + store.map(|s| s.load().settings.start_minimized).unwrap_or(false) + }; + + app::App::start(start_hidden); + if let Some(l) = listener { + platform::listen(l, || { + let _ = slint::invoke_from_event_loop(|| { + app::with_app(|a| a.show_window()); + }); + }); + } + + // Keep running with zero windows open: the tray and hotkeys live on. + if let Err(e) = slint::run_event_loop_until_quit() { + log::error!("event loop: {e}"); + } + app::App::shutdown(); +} + +fn select_backend() -> Result<(), slint::PlatformError> { + let selector = slint::BackendSelector::new() + .backend_name("winit".into()) + .renderer_name("software".into()) + .with_winit_window_attributes_hook(ui::toast::window_attributes_hook); + + // Menu-bar app on macOS: no Dock icon. + #[cfg(target_os = "macos")] + let selector = selector.with_winit_event_loop_builder({ + use slint::winit_030::winit::platform::macos::{ActivationPolicy, EventLoopBuilderExtMacOS}; + let mut b = slint::winit_030::winit::event_loop::EventLoop::with_user_event(); + b.with_activation_policy(ActivationPolicy::Accessory); + b + }); + + selector.select() +} + +/// `hushkey --list`: diagnostic dump, handy for bug reports. +fn list_apps() { + let mut ctl = match audio::create_controller() { + Ok(c) => c, + Err(e) => { + eprintln!("audio backend unavailable: {e}"); + std::process::exit(1); + } + }; + println!("backend: {}", ctl.backend_name()); + match ctl.list_audio_apps() { + Ok(apps) => { + for a in apps { + let vol = a.volume.map(|v| format!("{:>3.0}%", v * 100.0)).unwrap_or_else(|| " — ".into()); + println!("{:<32} {:<28} vol {vol} muted {:<5} pids {:?}", a.key, a.name, a.muted, a.pids); + } + } + Err(e) => eprintln!("error: {e}"), + } +} diff --git a/src/platform.rs b/src/platform.rs new file mode 100644 index 0000000..3790a2c --- /dev/null +++ b/src/platform.rs @@ -0,0 +1,86 @@ +//! Small OS integrations: launch-at-login, opening folders, single-instance guard. + +use std::io::{Read, Write}; +use std::net::{SocketAddr, TcpListener, TcpStream}; +use std::path::Path; +use std::time::Duration; + +pub const MINIMIZED_ARG: &str = "--minimized"; + +fn auto_launch() -> Result { + let exe = std::env::current_exe().map_err(|e| e.to_string())?; + let mut b = auto_launch::AutoLaunchBuilder::new(); + b.set_app_name("HushKey") + .set_app_path(&exe.to_string_lossy()) + .set_args(&[MINIMIZED_ARG]) + .set_macos_launch_mode(auto_launch::MacOSLaunchMode::LaunchAgent); + b.build().map_err(|e| e.to_string()) +} + +pub fn set_launch_on_startup(enabled: bool) -> Result<(), String> { + let al = auto_launch()?; + let currently = al.is_enabled().unwrap_or(false); + match (enabled, currently) { + (true, false) => al.enable().map_err(|e| e.to_string()), + (false, true) => al.disable().map_err(|e| e.to_string()), + _ => Ok(()), + } +} + +pub fn open_folder(path: &Path) { + #[cfg(target_os = "windows")] + let cmd = "explorer"; + #[cfg(target_os = "macos")] + let cmd = "open"; + #[cfg(not(any(target_os = "windows", target_os = "macos")))] + let cmd = "xdg-open"; + let _ = std::fs::create_dir_all(path); + if let Err(e) = std::process::Command::new(cmd).arg(path).spawn() { + log::warn!("open {}: {e}", path.display()); + } +} + +// ── Single instance ──────────────────────────────────────────────────────────── +// A loopback-only socket doubles as lock and "show yourself" signal: launching HushKey +// again just brings the running window up. Loopback binds don't trigger firewall prompts. + +const PORT: u16 = 47_219; +const MAGIC: &[u8] = b"HUSHKEY1\n"; + +pub enum Instance { + /// We're the first instance; call `listen` once the event loop is ready. + Primary(TcpListener), + /// Another HushKey is running and has been asked to show its window. + AlreadyRunning, + /// The port is taken by something else; run without the guard. + Unguarded, +} + +pub fn acquire_single_instance() -> Instance { + let addr = SocketAddr::from(([127, 0, 0, 1], PORT)); + match TcpListener::bind(addr) { + Ok(l) => Instance::Primary(l), + Err(_) => match TcpStream::connect_timeout(&addr, Duration::from_millis(300)) { + Ok(mut s) => { + let _ = s.set_read_timeout(Some(Duration::from_millis(500))); + let mut buf = [0u8; 9]; + if s.read_exact(&mut buf).is_ok() && buf == MAGIC { + Instance::AlreadyRunning + } else { + Instance::Unguarded + } + } + Err(_) => Instance::Unguarded, + }, + } +} + +/// Accept "show" pings from later launches on a tiny background thread. +pub fn listen(listener: TcpListener, on_ping: impl Fn() + Send + 'static) { + let _ = std::thread::Builder::new().name("hushkey-instance".into()).stack_size(64 * 1024).spawn(move || { + for mut stream in listener.incoming().flatten() { + let _ = stream.write_all(MAGIC); + on_ping(); + } + }); +} diff --git a/src/ui/icon.rs b/src/ui/icon.rs new file mode 100644 index 0000000..ddb5525 --- /dev/null +++ b/src/ui/icon.rs @@ -0,0 +1,128 @@ +//! The HushKey icon, rasterised at runtime (no image assets, no decoder dependency). +//! +//! A rounded square with a speaker glyph: violet with sound waves when audio is live, +//! coral with an × when muted. 4×4 supersampling gives clean anti-aliased edges at +//! tray sizes (16–32 px) and window-icon sizes. +//! +//! Std-only on purpose: `build.rs` includes this file to embed the same icon into the +//! Windows executable, so it must not depend on any crate. + +#[derive(Clone, Copy, PartialEq, Eq)] +pub enum IconState { + Normal, + Muted, +} + +pub fn render(size: u32, state: IconState) -> Vec { + let (top, bottom) = match state { + IconState::Normal => ([0x8a, 0x7b, 0xff], [0x5b, 0x49, 0xf2]), + IconState::Muted => ([0xff, 0x6b, 0x78], [0xe0, 0x40, 0x5a]), + }; + const SS: u32 = 4; + let mut out = vec![0u8; (size * size * 4) as usize]; + for py in 0..size { + for px in 0..size { + let mut bg_cov = 0.0f32; + let mut fg_cov = 0.0f32; + for sy in 0..SS { + for sx in 0..SS { + let x = (px as f32 + (sx as f32 + 0.5) / SS as f32) / size as f32; + let y = (py as f32 + (sy as f32 + 0.5) / SS as f32) / size as f32; + if in_rounded_rect(x, y, 0.02, 0.22) { + bg_cov += 1.0; + if in_glyph(x, y, state) { + fg_cov += 1.0; + } + } + } + } + let n = (SS * SS) as f32; + let (bg_a, fg_a) = (bg_cov / n, fg_cov / n); + let t = py as f32 / size as f32; + let base = [0, 1, 2].map(|i| top[i] as f32 * (1.0 - t) + bottom[i] as f32 * t); + let i = ((py * size + px) * 4) as usize; + if bg_a > 0.0 { + // White glyph over gradient (fg coverage is a fraction of bg coverage). + let mix = if bg_a > 0.0 { fg_a / bg_a } else { 0.0 }; + for c in 0..3 { + out[i + c] = (base[c] * (1.0 - mix) + 255.0 * mix).round() as u8; + } + out[i + 3] = (bg_a * 255.0).round() as u8; + } + } + } + out +} + +fn in_rounded_rect(x: f32, y: f32, inset: f32, r: f32) -> bool { + let (lo, hi) = (inset, 1.0 - inset); + if x < lo || x > hi || y < lo || y > hi { + return false; + } + let cx = x.clamp(lo + r, hi - r); + let cy = y.clamp(lo + r, hi - r); + (x - cx).powi(2) + (y - cy).powi(2) <= r * r +} + +fn in_glyph(x: f32, y: f32, state: IconState) -> bool { + // Speaker body + cone. + if (0.20..=0.34).contains(&x) && (0.40..=0.60).contains(&y) { + return true; + } + if in_convex(x, y, &[(0.32, 0.40), (0.50, 0.24), (0.50, 0.76), (0.32, 0.60)]) { + return true; + } + match state { + IconState::Normal => { + let (dx, dy) = (x - 0.50, y - 0.50); + let d = (dx * dx + dy * dy).sqrt(); + let angle_ok = dx > 0.0 && dy.abs() <= dx * 1.2; + angle_ok && ((0.115..=0.175).contains(&d) || (0.235..=0.295).contains(&d)) + } + IconState::Muted => { + seg_dist(x, y, (0.60, 0.39), (0.80, 0.61)) <= 0.035 || seg_dist(x, y, (0.60, 0.61), (0.80, 0.39)) <= 0.035 + } + } +} + +fn in_convex(x: f32, y: f32, pts: &[(f32, f32)]) -> bool { + let mut sign = 0.0f32; + for i in 0..pts.len() { + let (ax, ay) = pts[i]; + let (bx, by) = pts[(i + 1) % pts.len()]; + let cross = (bx - ax) * (y - ay) - (by - ay) * (x - ax); + if cross != 0.0 { + if sign != 0.0 && cross.signum() != sign { + return false; + } + sign = cross.signum(); + } + } + true +} + +fn seg_dist(x: f32, y: f32, a: (f32, f32), b: (f32, f32)) -> f32 { + let (vx, vy) = (b.0 - a.0, b.1 - a.1); + let t = (((x - a.0) * vx + (y - a.1) * vy) / (vx * vx + vy * vy)).clamp(0.0, 1.0); + let (px, py) = (a.0 + t * vx, a.1 + t * vy); + ((x - px).powi(2) + (y - py).powi(2)).sqrt() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn renders_opaque_center_and_transparent_corner() { + let px = render(32, IconState::Normal); + assert_eq!(px.len(), 32 * 32 * 4); + assert_eq!(px[3], 0, "top-left corner is outside the rounded rect"); + let center = ((16 * 32 + 16) * 4) as usize; + assert_eq!(px[center + 3], 255); + } + + #[test] + fn states_differ() { + assert_ne!(render(24, IconState::Normal), render(24, IconState::Muted)); + } +} diff --git a/src/ui/mod.rs b/src/ui/mod.rs new file mode 100644 index 0000000..341145d --- /dev/null +++ b/src/ui/mod.rs @@ -0,0 +1,41 @@ +//! Everything visual: the Slint components (compiled from `ui/*.slint` by build.rs), +//! the tray icon, the toast popup and the procedurally drawn app icon. + +pub mod icon; +pub mod toast; +pub mod tray; + +use crate::audio::IconData; +use icon::IconState; + +/// Deterministic avatar colour for apps without an icon. +pub fn tint_for(key: &str) -> slint::Color { + const PALETTE: [(u8, u8, u8); 8] = [ + (0x7b, 0x6b, 0xff), + (0x2f, 0xa8, 0xe0), + (0x24, 0xb3, 0x8a), + (0xe0, 0x8a, 0x2f), + (0xd9, 0x4f, 0x8f), + (0x5f, 0x7d, 0xf0), + (0xc0, 0x5c, 0xe0), + (0x3f, 0xa0, 0x6a), + ]; + let h = key.bytes().fold(0u32, |h, b| h.wrapping_mul(31).wrapping_add(b as u32)); + let (r, g, b) = PALETTE[(h as usize) % PALETTE.len()]; + slint::Color::from_rgb_u8(r, g, b) +} + +pub fn initial_for(name: &str) -> String { + name.chars().find(|c| c.is_alphanumeric()).map(|c| c.to_uppercase().collect()).unwrap_or_else(|| "?".into()) +} + +pub fn image_from_icon(icon: &IconData) -> slint::Image { + let buf = slint::SharedPixelBuffer::::clone_from_slice(&icon.rgba, icon.width, icon.height); + slint::Image::from_rgba8(buf) +} + +pub fn icon_image(size: u32, state: IconState) -> slint::Image { + let rgba = icon::render(size, state); + let buf = slint::SharedPixelBuffer::::clone_from_slice(&rgba, size, size); + slint::Image::from_rgba8(buf) +} diff --git a/src/ui/toast.rs b/src/ui/toast.rs new file mode 100644 index 0000000..f22d8de --- /dev/null +++ b/src/ui/toast.rs @@ -0,0 +1,121 @@ +//! The on-screen confirmation popup. +//! +//! It must never steal keyboard focus: a focus change would minimise a game running in +//! exclusive fullscreen or interrupt typing. So the winit window is created with +//! `active = false`, as a tool window (no taskbar entry), always-on-top and click-through. +//! Slint creates the native window when the component is constructed, so we flag "the +//! next window is a toast" and the global window-attributes hook (installed in `main`) +//! applies the toast-specific attributes. Window is created lazily and dropped after it +//! fades out, so it costs nothing while idle. +//! +//! Note: games using *exclusive* fullscreen (rare today; most use borderless) draw over +//! every other window, so the toast can't be seen there — the tray flash still happens. + +use crate::Toast; +use slint::winit_030::{winit, WinitWindowAccessor}; +use slint::ComponentHandle; +use std::cell::Cell; +use std::time::Duration; + +thread_local! { + static NEXT_WINDOW_IS_TOAST: Cell = const { Cell::new(false) }; +} + +const VISIBLE_FOR: Duration = Duration::from_millis(1400); +const FADE: Duration = Duration::from_millis(220); +const WIDTH: f64 = 300.0; +const HEIGHT: f64 = 76.0; +const BOTTOM_MARGIN: f64 = 110.0; + +/// Window-attribute hook: applied to every winit window Slint creates. +pub fn window_attributes_hook(attrs: winit::window::WindowAttributes) -> winit::window::WindowAttributes { + if !NEXT_WINDOW_IS_TOAST.with(|f| f.replace(false)) { + return attrs; + } + let attrs = attrs + .with_active(false) + .with_decorations(false) + .with_resizable(false) + .with_window_level(winit::window::WindowLevel::AlwaysOnTop); + #[cfg(target_os = "windows")] + let attrs = { + use winit::platform::windows::WindowAttributesExtWindows; + attrs.with_skip_taskbar(true).with_no_redirection_bitmap(false) + }; + attrs +} + +pub struct ToastPresenter { + toast: Option, + hide_timer: slint::Timer, + drop_timer: slint::Timer, +} + +impl ToastPresenter { + pub fn new() -> Self { + Self { toast: None, hide_timer: slint::Timer::default(), drop_timer: slint::Timer::default() } + } + + pub fn show(&mut self, dark: bool, headline: &str, detail: &str, muted: bool, error: bool) { + self.drop_timer.stop(); + if self.toast.is_none() { + NEXT_WINDOW_IS_TOAST.with(|f| f.set(true)); + let created = Toast::new(); + NEXT_WINDOW_IS_TOAST.with(|f| f.set(false)); + match created { + Ok(t) => self.toast = Some(t), + Err(e) => { + log::warn!("toast window: {e}"); + return; + } + } + } + let Some(t) = &self.toast else { return }; + t.set_dark(dark); + t.set_headline(headline.into()); + t.set_detail(detail.into()); + t.set_muted(muted); + t.set_error(error); + if let Err(e) = t.show() { + log::warn!("toast show: {e}"); + return; + } + t.window().with_winit_window(|w| { + w.set_cursor_hittest(false).ok(); + position_bottom_center(w); + }); + // Defer one frame so the fade-in animation runs from the hidden state. + let weak = t.as_weak(); + slint::Timer::single_shot(Duration::from_millis(16), move || { + if let Some(t) = weak.upgrade() { + t.set_shown(true); + } + }); + self.hide_timer.start(slint::TimerMode::SingleShot, VISIBLE_FOR, || { + crate::app::with_toast(|p| p.fade_out()); + }); + } + + fn fade_out(&mut self) { + if let Some(t) = &self.toast { + t.set_shown(false); + } + self.drop_timer.start(slint::TimerMode::SingleShot, FADE, || { + crate::app::with_toast(|p| { + if let Some(t) = p.toast.take() { + let _ = t.hide(); + } + }); + }); + } +} + +fn position_bottom_center(w: &winit::window::Window) { + let Some(monitor) = w.current_monitor().or_else(|| w.primary_monitor()) else { return }; + let scale = monitor.scale_factor(); + let (mx, my) = (monitor.position().x as f64, monitor.position().y as f64); + let (mw, mh) = (monitor.size().width as f64, monitor.size().height as f64); + let x = mx + (mw - WIDTH * scale) / 2.0; + let y = my + mh - (HEIGHT + BOTTOM_MARGIN) * scale; + w.set_outer_position(winit::dpi::PhysicalPosition::new(x.round() as i32, y.round() as i32)); +} diff --git a/src/ui/tray.rs b/src/ui/tray.rs new file mode 100644 index 0000000..68e15c2 --- /dev/null +++ b/src/ui/tray.rs @@ -0,0 +1,117 @@ +//! System tray / menu-bar icon. +//! +//! - Windows/macOS: native tray, created on the main thread after the event loop starts. +//! - Linux: StatusNotifierItem over D-Bus (`ksni` feature) — works on KDE, GNOME with +//! the AppIndicator extension, XFCE, Cinnamon, etc. No GTK main loop required. +//! +//! The icon reflects the Mute All state persistently and "flashes" to the muted/unmuted +//! glyph for a moment whenever a shortcut fires, as glanceable feedback. + +use super::icon::{self, IconState}; +use std::time::Duration; +use tray_icon::menu::{Menu, MenuEvent, MenuItem, PredefinedMenuItem}; +use tray_icon::{Icon, MouseButton, MouseButtonState, TrayIcon, TrayIconBuilder, TrayIconEvent}; + +pub const MENU_OPEN: &str = "open"; +pub const MENU_TOGGLE_ALL: &str = "toggle-all"; +pub const MENU_QUIT: &str = "quit"; + +const ICON_PX: u32 = 32; +const FLASH: Duration = Duration::from_millis(900); + +#[derive(Debug, Clone, Copy)] +pub enum TrayCommand { + Open, + ToggleAll, + Quit, +} + +pub struct Tray { + tray: TrayIcon, + toggle_item: MenuItem, + all_muted: bool, + flash_timer: slint::Timer, +} + +fn icon(state: IconState) -> Option { + Icon::from_rgba(icon::render(ICON_PX, state), ICON_PX, ICON_PX).ok() +} + +impl Tray { + /// `on_command` is invoked on the Slint event loop thread. + pub fn new(on_command: impl Fn(TrayCommand) + Send + Sync + Clone + 'static) -> Result { + let menu = Menu::new(); + let open = MenuItem::with_id(MENU_OPEN, "Open HushKey", true, None); + let toggle_item = MenuItem::with_id(MENU_TOGGLE_ALL, "Mute all", true, None); + let quit = MenuItem::with_id(MENU_QUIT, "Quit HushKey", true, None); + menu.append_items(&[&open, &toggle_item, &PredefinedMenuItem::separator(), &quit]) + .map_err(|e| e.to_string())?; + + let tray = TrayIconBuilder::new() + .with_menu(Box::new(menu)) + .with_menu_on_left_click(false) + .with_tooltip("HushKey") + .with_icon(icon(IconState::Normal).ok_or("icon")?) + .build() + .map_err(|e| e.to_string())?; + + let cmd = on_command.clone(); + MenuEvent::set_event_handler(Some(move |e: MenuEvent| { + let c = match e.id.0.as_str() { + MENU_OPEN => TrayCommand::Open, + MENU_TOGGLE_ALL => TrayCommand::ToggleAll, + MENU_QUIT => TrayCommand::Quit, + _ => return, + }; + let cmd = cmd.clone(); + let _ = slint::invoke_from_event_loop(move || cmd(c)); + })); + TrayIconEvent::set_event_handler(Some(move |e: TrayIconEvent| { + let open = matches!( + e, + TrayIconEvent::Click { button: MouseButton::Left, button_state: MouseButtonState::Up, .. } + | TrayIconEvent::DoubleClick { button: MouseButton::Left, .. } + ); + if open { + let cmd = on_command.clone(); + let _ = slint::invoke_from_event_loop(move || cmd(TrayCommand::Open)); + } + })); + + Ok(Self { tray, toggle_item, all_muted: false, flash_timer: slint::Timer::default() }) + } + + fn resting_state(&self) -> IconState { + if self.all_muted { + IconState::Muted + } else { + IconState::Normal + } + } + + pub fn set_all_muted(&mut self, muted: bool) { + self.all_muted = muted; + self.toggle_item.set_text(if muted { "Restore all" } else { "Mute all" }); + let _ = self.tray.set_tooltip(Some(if muted { "HushKey — everything muted" } else { "HushKey" })); + if !self.flash_timer.running() { + let _ = self.tray.set_icon(icon(self.resting_state())); + } + } + + /// Briefly show the muted/unmuted glyph, then return to the resting state. + pub fn flash(&self, muted: bool, restore: impl FnMut() + 'static) { + let _ = self.tray.set_icon(icon(if muted { IconState::Muted } else { IconState::Normal })); + self.flash_timer.start(slint::TimerMode::SingleShot, FLASH, restore); + } + + pub fn settle(&self) { + let _ = self.tray.set_icon(icon(self.resting_state())); + } +} + +impl Drop for Tray { + fn drop(&mut self) { + MenuEvent::set_event_handler(None::); + TrayIconEvent::set_event_handler(None::); + } +} diff --git a/ui/main.slint b/ui/main.slint new file mode 100644 index 0000000..69828f5 --- /dev/null +++ b/ui/main.slint @@ -0,0 +1,595 @@ +import { ListView, ScrollView, Palette } from "std-widgets.slint"; +import { Theme } from "theme.slint"; +import { + SpeakerIcon, ThemeIcon, IconButton, Tabs, Switch, ShortcutChip, SettingRow, Card, SectionLabel +} from "widgets.slint"; + +export { Toast } from "toast.slint"; + +export struct AppRow { + key: string, + name: string, + subtitle: string, + icon: image, + has-icon: bool, + initial: string, + tint: color, + running: bool, + muted: bool, + volume: float, // 0..1, < 0 when unknown + shortcut: string, // display label, "" when unbound +} + +component Avatar inherits Rectangle { + in property app; + width: 36px; + height: 36px; + border-radius: 10px; + background: app.has-icon ? transparent : app.tint; + if app.has-icon: Image { + source: root.app.icon; + width: 32px; + height: 32px; + image-fit: contain; + } + if !app.has-icon: Text { + text: root.app.initial; + color: white; + font-size: 15px; + font-weight: 700; + horizontal-alignment: center; + vertical-alignment: center; + } +} + +component MuteButton inherits Rectangle { + in property muted; + in property enabled: true; + in property label; + callback clicked; + width: 34px; + height: 34px; + border-radius: 17px; + background: muted ? Theme.danger-soft : (touch.has-hover ? Theme.surface-sunken : transparent); + opacity: enabled ? 1 : 0.4; + animate background { duration: Theme.fast; } + accessible-role: button; + accessible-label: (muted ? "Unmute " : "Mute ") + label; + accessible-action-default => { if (root.enabled) { root.clicked(); } } + SpeakerIcon { + muted: root.muted; + color: root.muted ? Theme.danger : Theme.text-muted; + } + touch := TouchArea { + enabled: root.enabled; + mouse-cursor: pointer; + clicked => { root.clicked(); } + } +} + +component AppRowView inherits Rectangle { + in property app; + in property capturing; + in property show-volume; + callback toggle(); + callback capture(); + callback clear(); + + height: 64px; + border-radius: 12px; + background: hover.has-hover ? Theme.surface-hover : Theme.surface; + border-width: 1px; + border-color: capturing ? Theme.accent : Theme.border; + animate background, border-color { duration: Theme.fast; } + + hover := TouchArea { } + + HorizontalLayout { + padding-left: 12px; + padding-right: 10px; + spacing: 12px; + alignment: stretch; + + VerticalLayout { + alignment: center; + Avatar { app: root.app; opacity: root.app.running ? 1 : 0.45; } + } + VerticalLayout { + alignment: center; + spacing: 3px; + horizontal-stretch: 1; + Text { + text: root.app.name; + font-size: 13.5px; + font-weight: 600; + color: root.app.running ? Theme.text : Theme.text-muted; + overflow: elide; + } + Text { + text: root.app.subtitle; + font-size: 11.5px; + color: root.app.muted ? Theme.danger : Theme.text-faint; + overflow: elide; + } + if root.show-volume && root.app.running && root.app.volume >= 0: Rectangle { + height: 3px; + border-radius: 1.5px; + background: Theme.surface-sunken; + Rectangle { + x: 0; + width: parent.width * clamp(root.app.volume, 0, 1); + height: parent.height; + border-radius: 1.5px; + background: root.app.muted ? Theme.text-faint : Theme.accent; + animate width { duration: 200ms; } + } + } + } + VerticalLayout { + alignment: center; + ShortcutChip { + width: 132px; + shortcut: root.app.shortcut; + capturing: root.capturing; + label: root.app.name + " shortcut"; + clicked => { root.capture(); } + cleared => { root.clear(); } + } + } + VerticalLayout { + alignment: center; + MuteButton { + muted: root.app.muted; + enabled: root.app.running; + label: root.app.name; + clicked => { root.toggle(); } + } + } + } +} + +component MuteAllCard inherits Rectangle { + in property all-muted; + in property app-count; + in property shortcut; + in property restore-shortcut; + in property capturing; + callback toggle(); + callback capture(string); + callback clear(string); + + border-radius: 18px; + background: all-muted + ? @linear-gradient(135deg, #ff6b78 0%, #e0405a 100%) + : @linear-gradient(135deg, #8a7bff 0%, #5b49f2 100%); + drop-shadow-blur: 18px; + drop-shadow-offset-y: 6px; + drop-shadow-color: all-muted ? #e0405a40 : #5b49f240; + + VerticalLayout { + padding: 16px; + spacing: 14px; + HorizontalLayout { + spacing: 12px; + VerticalLayout { + alignment: center; + spacing: 2px; + horizontal-stretch: 1; + Text { + text: root.all-muted ? "Everything is muted" : "Mute everything"; + color: white; + font-size: 16px; + font-weight: 700; + } + Text { + text: root.all-muted + ? "Press again to restore exactly what was playing" + : root.app-count == 1 ? "Instantly silence 1 app" : "Instantly silence " + root.app-count + " apps"; + color: #ffffffcc; + font-size: 12px; + overflow: elide; + } + } + Rectangle { + width: 46px; + height: 46px; + border-radius: 23px; + background: big.has-hover ? #ffffff : #fffffff0; + drop-shadow-blur: 8px; + drop-shadow-color: #00000033; + accessible-role: button; + accessible-label: root.all-muted ? "Restore all apps" : "Mute all apps"; + accessible-action-default => { root.toggle(); } + SpeakerIcon { + width: 22px; + height: 22px; + muted: root.all-muted; + color: root.all-muted ? #e0405a : #5b49f2; + } + big := TouchArea { + mouse-cursor: pointer; + clicked => { root.toggle(); } + } + } + } + HorizontalLayout { + spacing: 8px; + VerticalLayout { + spacing: 4px; + horizontal-stretch: 1; + Text { text: "TOGGLE"; color: #ffffffa6; font-size: 10px; font-weight: 700; letter-spacing: 0.8px; } + ShortcutChip { + on-accent: true; + shortcut: root.shortcut; + capturing: root.capturing == "@all"; + label: "Mute all shortcut"; + clicked => { root.capture("@all"); } + cleared => { root.clear("@all"); } + } + } + VerticalLayout { + spacing: 4px; + horizontal-stretch: 1; + Text { text: "RESTORE (OPTIONAL)"; color: #ffffffa6; font-size: 10px; font-weight: 700; letter-spacing: 0.8px; } + ShortcutChip { + on-accent: true; + shortcut: root.restore-shortcut; + placeholder: "Same as toggle"; + capturing: root.capturing == "@restore"; + label: "Restore all shortcut"; + clicked => { root.capture("@restore"); } + cleared => { root.clear("@restore"); } + } + } + } + } +} + +export component MainWindow inherits Window { + title: "HushKey"; + icon: root.app-icon; + preferred-width: 460px; + preferred-height: 660px; + min-width: 400px; + min-height: 480px; + background: Theme.bg; + default-font-size: 13px; + + in property dark: true; + in property app-icon; + in property <[AppRow]> apps; + in property all-muted; + in property running-count; + in property mute-all-shortcut; + in property restore-shortcut; + in property capturing; // "" | "@all" | "@restore" | app key + in property status; + in property status-is-error; + in property backend; + in property platform-note; + in property show-volume: true; + in property config-path; + in property version; + in property hotkey-hint; + in property launch-on-startup; + in property start-minimized; + in property show-toast: true; + in-out property page; + + callback start-capture(string); + callback key-captured(string, bool, bool, bool, bool); + callback cancel-capture(); + callback clear-shortcut(string); + callback toggle-app(string); + callback toggle-all(); + callback set-launch-on-startup(bool); + callback set-start-minimized(bool); + callback set-show-toast(bool); + callback set-dark(bool); + callback open-config-dir(); + callback refresh(); + callback dismiss-status(); + + init => { + Theme.dark = root.dark; + Palette.color-scheme = root.dark ? ColorScheme.dark : ColorScheme.light; + } + changed dark => { + Theme.dark = root.dark; + Palette.color-scheme = root.dark ? ColorScheme.dark : ColorScheme.light; + } + + function begin-capture(target: string) { + root.start-capture(target); + key-sink.focus(); + } + + // Receives the key combo while a shortcut chip is recording. + key-sink := FocusScope { + key-pressed(event) => { + if (root.capturing != "") { + root.key-captured(event.text, event.modifiers.control, event.modifiers.alt, event.modifiers.shift, event.modifiers.meta); + return accept; + } + return reject; + } + + VerticalLayout { + // ── Header ────────────────────────────────────────────── + HorizontalLayout { + padding-left: 18px; + padding-right: 14px; + padding-top: 14px; + padding-bottom: 10px; + spacing: 10px; + VerticalLayout { + alignment: center; + Image { source: root.app-icon; width: 26px; height: 26px; } + } + Text { + text: "HushKey"; + font-size: 17px; + font-weight: 750; + color: Theme.text; + vertical-alignment: center; + } + Rectangle { horizontal-stretch: 1; } + VerticalLayout { + alignment: center; + Tabs { + items: ["Apps", "Settings"]; + selected <=> root.page; + } + } + VerticalLayout { + alignment: center; + IconButton { + tooltip: root.dark ? "Switch to light mode" : "Switch to dark mode"; + clicked => { root.set-dark(!root.dark); } + ThemeIcon { dark: root.dark; } + } + } + } + + // ── Apps page ─────────────────────────────────────────── + if root.page == 0: VerticalLayout { + padding-left: 16px; + padding-right: 16px; + padding-top: 4px; + spacing: 12px; + vertical-stretch: 1; + + MuteAllCard { + all-muted: root.all-muted; + app-count: root.running-count; + shortcut: root.mute-all-shortcut; + restore-shortcut: root.restore-shortcut; + capturing: root.capturing; + toggle => { root.toggle-all(); } + capture(t) => { root.begin-capture(t); } + clear(t) => { root.clear-shortcut(t); } + } + + if root.platform-note != "": Rectangle { + border-radius: 10px; + background: Theme.accent-soft; + HorizontalLayout { + padding: 10px; + Text { + text: root.platform-note; + font-size: 12px; + color: Theme.text; + wrap: word-wrap; + } + } + } + + HorizontalLayout { + padding-top: 2px; + SectionLabel { text: "APPLICATIONS"; vertical-alignment: center; } + Rectangle { horizontal-stretch: 1; } + Text { + text: root.capturing != "" ? root.hotkey-hint : (root.running-count + " with audio"); + font-size: 11.5px; + color: root.capturing != "" ? Theme.accent : Theme.text-faint; + vertical-alignment: center; + } + } + + if root.apps.length == 0: Rectangle { + vertical-stretch: 1; + VerticalLayout { + alignment: center; + spacing: 6px; + SpeakerIcon { width: 30px; height: 30px; color: Theme.text-faint; } + Text { + text: "No apps with audio yet"; + font-size: 14px; + font-weight: 600; + color: Theme.text-muted; + horizontal-alignment: center; + } + Text { + text: "Start playing something — it will show up here."; + font-size: 12px; + color: Theme.text-faint; + horizontal-alignment: center; + } + } + } + + if root.apps.length > 0: ListView { + vertical-stretch: 1; + for row in root.apps: VerticalLayout { + padding-bottom: 8px; + padding-right: 12px; // keep clear of the overlay scrollbar + AppRowView { + app: row; + capturing: root.capturing == row.key; + show-volume: root.show-volume; + toggle => { root.toggle-app(row.key); } + capture => { root.begin-capture(row.key); } + clear => { root.clear-shortcut(row.key); } + } + } + } + } + + // ── Settings page ─────────────────────────────────────── + if root.page == 1: ScrollView { + vertical-stretch: 1; + VerticalLayout { + padding-left: 16px; + padding-right: 16px; + padding-top: 4px; + padding-bottom: 16px; + spacing: 10px; + alignment: start; + + SectionLabel { text: "GENERAL"; } + Card { + VerticalLayout { + SettingRow { + title: "Launch at login"; + subtitle: "Start HushKey in the tray when you sign in."; + Switch { + label: "Launch at login"; + checked: root.launch-on-startup; + toggled(v) => { root.set-launch-on-startup(v); } + } + } + Rectangle { height: 1px; background: Theme.border; } + SettingRow { + title: "Start minimized"; + subtitle: "Open straight to the tray instead of showing this window."; + Switch { + label: "Start minimized"; + checked: root.start-minimized; + toggled(v) => { root.set-start-minimized(v); } + } + } + Rectangle { height: 1px; background: Theme.border; } + SettingRow { + title: "On-screen confirmation"; + subtitle: "Show a small popup when a shortcut mutes or unmutes something."; + Switch { + label: "On-screen confirmation"; + checked: root.show-toast; + toggled(v) => { root.set-show-toast(v); } + } + } + } + } + + SectionLabel { text: "APPEARANCE"; } + Card { + SettingRow { + title: "Theme"; + Tabs { + items: ["Dark", "Light"]; + selected: root.dark ? 0 : 1; + changed selected => { root.set-dark(self.selected == 0); } + } + } + } + + SectionLabel { text: "ABOUT"; } + Card { + VerticalLayout { + padding: 16px; + spacing: 6px; + Text { + text: "HushKey " + root.version; + font-size: 14px; + font-weight: 700; + color: Theme.text; + } + Text { + text: "Audio backend: " + root.backend; + font-size: 12px; + color: Theme.text-muted; + wrap: word-wrap; + } + Text { + text: "Settings file: " + root.config-path; + font-size: 12px; + color: Theme.text-muted; + wrap: word-wrap; + } + HorizontalLayout { + alignment: start; + padding-top: 4px; + Rectangle { + height: 30px; + border-radius: 8px; + background: open.has-hover ? Theme.surface-hover : Theme.surface-sunken; + border-width: 1px; + border-color: Theme.border; + accessible-role: button; + accessible-label: "Open settings folder"; + accessible-action-default => { root.open-config-dir(); } + HorizontalLayout { + padding-left: 12px; + padding-right: 12px; + Text { text: "Open settings folder"; font-size: 12px; font-weight: 600; color: Theme.text; vertical-alignment: center; } + } + open := TouchArea { + mouse-cursor: pointer; + clicked => { root.open-config-dir(); } + } + } + } + Text { + text: "MIT License · Built with Slint (slint.dev) · Created using Claude Opus 5.5"; + font-size: 11px; + color: Theme.text-faint; + wrap: word-wrap; + } + } + } + } + } + + // ── Status banner ─────────────────────────────────────── + if root.status != "": HorizontalLayout { + padding-left: 16px; + padding-right: 16px; + padding-bottom: 12px; + Rectangle { + border-radius: 10px; + background: root.status-is-error ? Theme.danger-soft : Theme.accent-soft; + HorizontalLayout { + padding-left: 12px; + padding-right: 6px; + padding-top: 6px; + padding-bottom: 6px; + spacing: 8px; + Text { + text: root.status; + font-size: 12px; + color: Theme.text; + wrap: word-wrap; + vertical-alignment: center; + horizontal-stretch: 1; + } + IconButton { + width: 26px; + height: 26px; + tooltip: "Dismiss"; + clicked => { root.dismiss-status(); } + Path { + width: 10px; + height: 10px; + viewbox-width: 10; + viewbox-height: 10; + commands: "M1 1l8 8 M9 1l-8 8"; + stroke: Theme.text-muted; + stroke-width: 1.5px; + } + } + } + } + } + } + } +} diff --git a/ui/theme.slint b/ui/theme.slint new file mode 100644 index 0000000..668631f --- /dev/null +++ b/ui/theme.slint @@ -0,0 +1,26 @@ +// Design tokens. Dark is the default; `Theme.dark` is driven from Rust via MainWindow.dark. + +export global Theme { + in-out property dark: true; + + out property bg: dark ? #0d0f13 : #f3f4f7; + out property surface: dark ? #161920 : #ffffff; + out property surface-hover: dark ? #1c2029 : #f7f8fa; + out property surface-sunken: dark ? #11141a : #eceef2; + out property border: dark ? #232833 : #e2e5eb; + out property border-strong: dark ? #323949 : #cfd4dc; + out property text: dark ? #e9ebf0 : #12141a; + out property text-muted: dark ? #8b92a1 : #687080; + out property text-faint: dark ? #5d6473 : #9aa1ae; + + out property accent: #7b6bff; + out property accent-strong: #5b49f2; + out property accent-soft: dark ? #7b6bff24 : #7b6bff1a; + out property danger: #ff5a6a; + out property danger-soft: dark ? #ff5a6a26 : #ff5a6a1c; + out property success: #34c98a; + + out property radius: 14px; + out property radius-sm: 9px; + out property fast: 140ms; +} diff --git a/ui/toast.slint b/ui/toast.slint new file mode 100644 index 0000000..8a987d3 --- /dev/null +++ b/ui/toast.slint @@ -0,0 +1,77 @@ +// On-screen confirmation shown when a shortcut fires. Created as a non-activating, +// click-through, always-on-top window (see src/ui/toast.rs) so it never steals focus +// from a game or fullscreen app. + +import { Theme } from "theme.slint"; +import { SpeakerIcon } from "widgets.slint"; + +export component Toast inherits Window { + title: "HushKey notification"; + no-frame: true; + always-on-top: true; + background: transparent; + width: 300px; + height: 76px; + + in property dark: true; + in property headline; + in property detail; + in property muted; + in property error; + in-out property shown; + + init => { Theme.dark = root.dark; } + changed dark => { Theme.dark = root.dark; } + + panel := Rectangle { + x: 10px; + y: root.shown ? 8px : 14px; + width: parent.width - 20px; + height: parent.height - 20px; + border-radius: 16px; + background: Theme.dark ? #1a1d25f5 : #fffffff7; + border-width: 1px; + border-color: Theme.border; + drop-shadow-blur: 10px; + drop-shadow-color: #00000059; + drop-shadow-offset-y: 3px; + opacity: root.shown ? 1 : 0; + animate opacity { duration: 170ms; easing: ease-out; } + animate y { duration: 220ms; easing: ease-out; } + + HorizontalLayout { + padding-left: 12px; + padding-right: 16px; + spacing: 12px; + alignment: start; + Rectangle { + width: 36px; + height: 36px; + y: (parent.height - self.height) / 2; + border-radius: 18px; + background: root.error ? Theme.surface-sunken : (root.muted ? Theme.danger-soft : #34c98a2e); + SpeakerIcon { + muted: root.muted || root.error; + color: root.error ? Theme.text-muted : (root.muted ? Theme.danger : Theme.success); + } + } + VerticalLayout { + alignment: center; + spacing: 1px; + Text { + text: root.headline; + font-size: 14px; + font-weight: 650; + color: Theme.text; + overflow: elide; + } + Text { + text: root.detail; + font-size: 12px; + color: Theme.text-muted; + overflow: elide; + } + } + } + } +} diff --git a/ui/widgets.slint b/ui/widgets.slint new file mode 100644 index 0000000..ab31171 --- /dev/null +++ b/ui/widgets.slint @@ -0,0 +1,260 @@ +// Small reusable building blocks. Everything is drawn with Slint primitives +// (no icon fonts, no images) so it renders identically on every OS. + +import { Theme } from "theme.slint"; + +export component SpeakerIcon inherits Path { + in property muted; + in property color: Theme.text; + viewbox-width: 24; + viewbox-height: 24; + width: 18px; + height: 18px; + stroke: color; + stroke-width: 1.9px; + fill: transparent; + commands: muted + ? "M4 9.5h3.5L12 5.5v13l-4.5-4H4z M15.5 9.5l5 5 M20.5 9.5l-5 5" + : "M4 9.5h3.5L12 5.5v13l-4.5-4H4z M15.5 9a4 4 0 0 1 0 6 M18.2 6.5a7.6 7.6 0 0 1 0 11"; +} + +export component ThemeIcon inherits Path { + in property dark; + viewbox-width: 24; + viewbox-height: 24; + width: 17px; + height: 17px; + stroke: Theme.text-muted; + stroke-width: 1.8px; + fill: transparent; + // Moon in dark mode (click → light), sun in light mode. + commands: dark + ? "M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z" + : "M16 12a4 4 0 1 1-8 0a4 4 0 1 1 8 0z M12 2.5v2 M12 19.5v2 M2.5 12h2 M19.5 12h2 M5.3 5.3l1.4 1.4 M17.3 17.3l1.4 1.4 M5.3 18.7l1.4-1.4 M17.3 6.7l1.4-1.4"; +} + +export component IconButton inherits Rectangle { + callback clicked; + in property tooltip; + width: 32px; + height: 32px; + border-radius: 9px; + background: touch.has-hover ? Theme.surface-hover : transparent; + animate background { duration: Theme.fast; } + accessible-role: button; + accessible-label: tooltip; + accessible-action-default => { root.clicked(); } + touch := TouchArea { + mouse-cursor: pointer; + clicked => { root.clicked(); } + } + @children +} + +export component Tabs inherits Rectangle { + in property <[string]> items; + in-out property selected; + height: 32px; + border-radius: 10px; + background: Theme.surface-sunken; + HorizontalLayout { + padding: 3px; + spacing: 2px; + for item[i] in root.items: Rectangle { + border-radius: 7px; + background: i == root.selected ? Theme.surface : transparent; + drop-shadow-blur: i == root.selected ? 4px : 0; + drop-shadow-color: #0000001f; + animate background { duration: Theme.fast; } + accessible-role: tab; + accessible-label: item; + accessible-action-default => { root.selected = i; } + HorizontalLayout { + padding-left: 12px; + padding-right: 12px; + Text { + text: item; + font-size: 12.5px; + font-weight: i == root.selected ? 600 : 500; + color: i == root.selected ? Theme.text : Theme.text-muted; + vertical-alignment: center; + horizontal-alignment: center; + } + } + TouchArea { + mouse-cursor: pointer; + clicked => { root.selected = i; } + } + } + } +} + +export component Switch inherits Rectangle { + in-out property checked; + in property label; + callback toggled(bool); + width: 40px; + height: 23px; + border-radius: self.height / 2; + background: checked ? Theme.accent : Theme.border-strong; + animate background { duration: Theme.fast; } + accessible-role: switch; + accessible-checkable: true; + accessible-checked: checked; + accessible-label: label; + accessible-action-default => { touch.clicked(); } + knob := Rectangle { + width: parent.height - 6px; + height: self.width; + y: 3px; + x: root.checked ? parent.width - self.width - 3px : 3px; + border-radius: self.width / 2; + background: white; + drop-shadow-blur: 3px; + drop-shadow-color: #00000040; + animate x { duration: 160ms; easing: ease-out; } + } + touch := TouchArea { + mouse-cursor: pointer; + clicked => { + root.checked = !root.checked; + root.toggled(root.checked); + } + } +} + +// Click → "Press keys…" → shows the captured combo. × clears it. +export component ShortcutChip inherits Rectangle { + in property shortcut; + in property capturing; + in property on-accent; // white-on-gradient styling for the Mute All card + in property enabled: true; + in property placeholder: "Set shortcut"; + in property label; // accessibility label, e.g. "Spotify shortcut" + callback clicked; + callback cleared; + + property blink; + property bound: shortcut != ""; + + height: 30px; + min-width: 104px; + border-radius: 8px; + border-width: 1px; + border-color: capturing + ? (on-accent ? white : Theme.accent) + : on-accent ? #ffffff59 : (bound ? Theme.border-strong : Theme.border); + background: on-accent + ? (capturing ? #ffffff38 : (touch.has-hover ? #ffffff2e : #ffffff1f)) + : capturing ? Theme.accent-soft : (bound ? Theme.surface-sunken : (touch.has-hover ? Theme.surface-hover : transparent)); + opacity: enabled ? 1 : 0.5; + animate background, border-color { duration: Theme.fast; } + + accessible-role: button; + accessible-label: label + ": " + (capturing ? "press a key combination" : (bound ? shortcut : "not set")); + accessible-action-default => { root.clicked(); } + + Timer { + interval: 450ms; + running: root.capturing; + triggered => { root.blink = !root.blink; } + } + + touch := TouchArea { + enabled: root.enabled; + mouse-cursor: pointer; + clicked => { root.clicked(); } + } + + HorizontalLayout { + padding-left: 10px; + padding-right: root.bound && !root.capturing ? 4px : 10px; + spacing: 6px; + if root.capturing: Rectangle { + width: 7px; + height: 7px; + y: (parent.height - self.height) / 2; + border-radius: 3.5px; + background: root.on-accent ? white : Theme.accent; + opacity: root.blink ? 0.25 : 1; + animate opacity { duration: 200ms; } + } + Text { + text: root.capturing ? "Press keys…" : (root.bound ? root.shortcut : root.placeholder); + font-size: 12px; + font-weight: root.bound && !root.capturing ? 600 : 500; + color: root.on-accent ? white : (root.capturing ? Theme.accent : (root.bound ? Theme.text : Theme.text-muted)); + vertical-alignment: center; + horizontal-alignment: center; + horizontal-stretch: 1; + overflow: elide; + } + if root.bound && !root.capturing: Rectangle { + width: 22px; + height: 22px; + y: (parent.height - self.height) / 2; + border-radius: 6px; + background: clear.has-hover ? (root.on-accent ? #ffffff33 : Theme.border) : transparent; + accessible-role: button; + accessible-label: "Clear shortcut"; + accessible-action-default => { root.cleared(); } + Path { + width: 10px; + height: 10px; + viewbox-width: 10; + viewbox-height: 10; + commands: "M1 1l8 8 M9 1l-8 8"; + stroke: root.on-accent ? white : Theme.text-muted; + stroke-width: 1.5px; + } + clear := TouchArea { + mouse-cursor: pointer; + clicked => { root.cleared(); } + } + } + } +} + +export component SettingRow inherits Rectangle { + in property title; + in property subtitle; + min-height: 58px; + HorizontalLayout { + padding-left: 16px; + padding-right: 16px; + padding-top: 10px; + padding-bottom: 10px; + spacing: 12px; + VerticalLayout { + alignment: center; + spacing: 2px; + horizontal-stretch: 1; + Text { text: root.title; font-size: 13.5px; font-weight: 600; color: Theme.text; } + if root.subtitle != "": Text { + text: root.subtitle; + font-size: 12px; + color: Theme.text-muted; + wrap: word-wrap; + } + } + VerticalLayout { + alignment: center; + @children + } + } +} + +export component Card inherits Rectangle { + background: Theme.surface; + border-radius: Theme.radius; + border-width: 1px; + border-color: Theme.border; + @children +} + +export component SectionLabel inherits Text { + font-size: 11px; + font-weight: 700; + letter-spacing: 0.8px; + color: Theme.text-faint; +}