π English | Π ΡΡΡΠΊΠΈΠΉ
A lightweight, native macOS menu bar daemon for controlling Yandex Music via function keys.
YamKeys is a background daemon designed for macOS that binds function keys F7, F8, and F9 directly to the official Yandex Music desktop application (ru.yandex.desktop.music). It intercepts physical key events at the HID layer to provide seamless playback control while preventing macOS from launching default media players such as Apple Music.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YamKeys Daemon β
βββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ€
β Key Press β Action β
βββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β F7 β Previous Track β
β F8 β Play / Pause (or launch app if closed) β
β F9 β Next Track β
βββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββ
- Direct Application Control: Targets the native Yandex Music desktop application process without interfering with browser media.
- Smart App Dispatching: Pressing
F8when Yandex Music is closed automatically launches the application; when running, it toggles playback state. - System Event Interception: Captures function key presses via
CGEventTapto override default system media behaviors. - Native Menu Bar Interface: Operates in accessory mode (
LSUIElement = true) with a template status icon that adapts to macOS light and dark themes. - Thread-Safe Architecture: Uses
os_unfair_lockfor thread safety without introducing input latency or high CPU usage.
| File | Purpose |
|---|---|
main.swift |
Application entry point and permission polling lifecycle. |
StatusBarController.swift |
Status bar item, menu construction, and system event handlers. |
EventTapListener.swift |
Thread-safe low-level CGEventTap keyboard event listener. |
YandexMusicController.swift |
Process detection and media key dispatching for Yandex Music. |
PermissionManager.swift |
macOS TCC Accessibility authorization management. |
Localization.swift |
Native system language detection and UI string localization. |
- macOS 11.0 Big Sur or later
- Accessibility (TCC) permission granted
# Clone the repository
git clone https://github.com/Fuheshka/YamKeys.git
cd YamKeys
# Build release binary and package installer
./scripts/package-release.shThe build script compiles the release binary via SwiftPM, applies a code signature with a stable designated identifier, and produces YamKeys.app, YamKeys-v1.0.0.dmg, and YamKeys-v1.0.0.zip inside the dist/ directory.
This project is licensed under the terms of the MIT License. See the LICENSE file for details.