Skip to content

Apple Silicon support with custom volume HUD#40

Open
juniqlim wants to merge 4 commits into
rlxone:masterfrom
juniqlim:master
Open

Apple Silicon support with custom volume HUD#40
juniqlim wants to merge 4 commits into
rlxone:masterfrom
juniqlim:master

Conversation

@juniqlim

Copy link
Copy Markdown

Summary

  • Adds native Apple Silicon (arm64) build support
  • Replaces the broken/x86-only OSD private framework with a self-drawn NSWindow HUD
  • Adds a percentage label to the menu popup volume slider

Changes

  • Remove `EXCLUDED_ARCHS = arm64`; bump deployment target 10.10 → 13.0
  • Drop compile-time link to `OSD.framework`; resolve via `Bundle`/`dlopen` (no longer used after HUD switch but kept fallback path lean)
  • New `VolumeHUD.swift`: rounded translucent panel with speaker icon, 16-step chiclet bar, and volume percentage. Auto-fades after ~1.2s, repositions to active screen, uses `orderFrontRegardless()` so it never steals focus
  • Volume slider in menu popup now shows current % next to the slider

Why

The bundled `OSD.framework` is x86_64-only, so the project couldn't build natively on Apple Silicon. The system OSD chiclet API also stopped rendering steps on macOS Tahoe (26), so even Rosetta builds showed only a blank bar. A self-drawn HUD avoids both problems and isn't tied to private API behavior.

Test plan

  • Builds and runs natively on Apple Silicon (M2 Pro, macOS 26.4)
  • Volume keys adjust aggregate device volume
  • HUD renders with chiclet steps, percentage, and correct speaker/muted icon
  • HUD does not steal focus from the active app
  • Menu popup slider shows live percentage

juniq and others added 4 commits May 10, 2026 18:35
- Remove EXCLUDED_ARCHS = arm64; bump deployment target 10.10 -> 13.0
- Drop compile-time link to OSD.framework; load via dlopen at runtime
- Add volume percent label to menu popup slider
- Add temporary NSLog for debugging
- Replace broken OSD private API call with self-drawn NSWindow overlay
- Show speaker icon, chiclet bar, and volume percentage on key press
- Auto-fade after 1.2s, positioned at bottom-center of active screen
- Remove debug NSLog statements
Tint the SF Symbol via an offscreen image with sourceAtop fill
since NSColor.set() is ignored when drawing template images directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant