Skip to content
FuheshkaPublic

About

🎡 Native macOS MenuBar utility to control Yandex Music app using system media keys (F7, F8, F9)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

YamKeys Icon

YamKeys

🌐 English | Русский

A lightweight, native macOS menu bar daemon for controlling Yandex Music via function keys.

Platform Language License Views


Overview

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                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Features

  • Direct Application Control: Targets the native Yandex Music desktop application process without interfering with browser media.
  • Smart App Dispatching: Pressing F8 when Yandex Music is closed automatically launches the application; when running, it toggles playback state.
  • System Event Interception: Captures function key presses via CGEventTap to 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_lock for thread safety without introducing input latency or high CPU usage.

Technical Architecture

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.

Installation & Building

Requirements

  • macOS 11.0 Big Sur or later
  • Accessibility (TCC) permission granted

Building from Source

# Clone the repository
git clone https://github.com/Fuheshka/YamKeys.git
cd YamKeys

# Build release binary and package installer
./scripts/package-release.sh

The 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.


License

This project is licensed under the terms of the MIT License. See the LICENSE file for details.

About

🎡 Native macOS MenuBar utility to control Yandex Music app using system media keys (F7, F8, F9)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages