Skip to content

Add a macOS and Linux preview (read-only) - #1

Open
HelloAxoxelol wants to merge 1 commit into
mainfrom
mac-linux
Open

HelloAxoxelol wants to merge 1 commit into
mainfrom
mac-linux

Conversation

@HelloAxoxelol

Copy link
Copy Markdown
Owner

Adds a preview of CompxTray for macOS and Linux. It shows the battery level in the menu bar or tray and the mouse's settings, read-only for now.

What changes

Shared protocol code. src/Device/CompxDevice.cs no longer contains the Windows HID calls. They moved to src/Device/WinHid.cs. The protocol, ConfigMap and MouseConfig are now shared by both builds. The Windows app is still built with build.bat (csc.exe, C# 5, no SDK), and the files under tools/ include WinHid.cs.

cross/: the new macOS and Linux build (.NET 10)

  • Core: links the shared files and adds a HidSharp transport
  • App (Avalonia 12): menu bar / tray icon with the battery level, low battery notifications, start at login and a read-only settings window
  • Cli: compxtray-cli with battery, settings, diagnose and devices
  • linux/: tar.gz with install.sh and a udev rule (uaccess) for access to the receiver without root
  • macos/: ad-hoc signed CompxTray.app (LSUIElement, no Dock icon) for Apple silicon and Intel. It is not notarized.

App and CLI are trimmed (about 45 MB and 11–13 MB). HidSharp is kept whole because it is not trim-safe.

Workflow. New Linux and macOS jobs run on every push and PR. Tagged releases now collect the Windows, Linux and macOS packages in one release job. The Windows asset names are unchanged.

Docs. README has a "macOS and Linux (preview)" section, plus a line in the Swedish section. CHANGELOG has an Unreleased entry. cross/THIRD-PARTY-NOTICES.txt ships in the packages.

Testing

  • Windows, with a Svive Flow 7: the refactored Windows app reads the battery as before. compxtray-cli and the Avalonia app, run on Windows through HidSharp, read the same battery level, firmware and settings as the Windows app. The trimmed build behaves the same.
  • The build workflow on this branch passed for all four jobs: Windows, linux-x64, osx-arm64 and osx-x64.
  • Not tested on a real Mac or Linux PC. It is still unknown whether macOS asks for Input Monitoring, and how the tray icon behaves on different Linux desktops.
  • Writing settings was not exercised after the transport split. The write code itself is unchanged, and the cross-platform build does not write.

🤖 Generated with Claude Code

The protocol code in src/Device is now separate from the Windows HID
transport (WinHid.cs), so the Windows build (csc.exe, C# 5) and the new
cross-platform build share CompxDevice, ConfigMap and MouseConfig.

cross/ holds the new build:
- Core: the shared files plus a HidSharp transport
- App: a menu bar / tray icon with the battery level, low battery
  notifications, start at login and a read-only settings window
- Cli: compxtray-cli with battery, settings, diagnose and devices
- linux/ and macos/: packaging, an installer, a udev rule for access
  without root, and an ad-hoc signed CompxTray.app

The build workflow gets Linux and macOS jobs, and tagged releases now
collect the Windows, Linux and macOS packages in one release job.

Tested against a Svive Flow 7 on Windows only; not yet run on a real
Mac or Linux PC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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