Linux device manager for Logitech devices
Go to file
Din Tort e906b83103
MacOS: app wrapper and launch agent scripts #1244 (#3008)
* Add scripts to create macOS app bundle and LaunchAgent #1244

This change introduces two new helper scripts for macOS users to improve integration with the operating system.

The `create-macos-app.sh` script builds a minimal `.app` wrapper for Solaar. This allows Solaar to be treated as a standard macOS application, enabling it to request necessary permissions, such as input monitoring, and to be discoverable by the OS. The script generates the required directory structure, a wrapper executable to launch Solaar, a standard `Info.plist` file, and an application icon from the source PNG.

The `create-macos-launchagent.sh` script sets up a LaunchAgent to automatically start Solaar at login and keep it running in the background. This ensures that the Solaar process is always available for device management without requiring manual intervention from the user. The script also configures log file locations for standard output and error streams.

Together, these scripts provide a more native and user-friendly experience for Solaar on macOS.

https://github.com/pwr-Solaar/Solaar/issues/1244

* Fix icon in script to create macOS app bundle #1244

https://github.com/pwr-Solaar/Solaar/issues/1244

* build: Remove hardcoded Homebrew path for solaar in macOS script

The `create-macos-app.sh` script previously defaulted to a hardcoded Homebrew path for the `solaar` executable. This change removes the specific path, defaulting instead to `solaar`.

This modification makes the script more flexible and robust. It allows the system's `PATH` to resolve the location of the `solaar` binary, accommodating various installation methods beyond a fixed Homebrew directory. The explicit check for the executable's existence is also removed, as the script will now rely on the command being available in the shell's environment, which is a more standard approach.

* refactor(macos): Improve solaar executable lookup in launchagent script

This change improves how the `create-macos-launchagent.sh` script locates the `solaar` executable.

Previously, the script defaulted to a hardcoded path (`/opt/homebrew/bin/solaar`) and would exit with an error if that specific file was not found and executable. This was too restrictive and failed in environments where `solaar` is installed in a different location, such as through `pipx` or in standard system paths like `/usr/local/bin`.

Now, the script defaults the `SOLAAR_PATH` to just `solaar` and uses the `command -v` utility to find the executable in the user's `PATH`. This allows the system to resolve the correct location of the `solaar` binary automatically. If the executable cannot be found in the `PATH`, the script now issues a warning instead of exiting, and proceeds to use the provided `SOLAAR_PATH` value in the generated LaunchAgent plist. This makes the script more flexible and robust for different installation methods.

* refactor(macos): Improve solaar executable lookup in launchagent script

This change improves how the `create-macos-launchagent.sh` script locates the `solaar` executable.

Previously, the script defaulted to a hardcoded path (`/opt/homebrew/bin/solaar`) and would exit with an error if that specific file was not found and executable. This was too restrictive and failed in environments where `solaar` is installed in a different location, such as through `pipx` or in standard system paths like `/usr/local/bin`.

Now, the script defaults the `SOLAAR_PATH` to just `solaar` and uses the `command -v` utility to find the executable in the user's `PATH`. This allows the system to resolve the correct location of the `solaar` binary automatically. If the executable cannot be found in the `PATH`, the script now issues a warning instead of exiting, and proceeds to use the provided `SOLAAR_PATH` value in the generated LaunchAgent plist. This makes the script more flexible and robust for different installation methods.

* refactor: Improve Solaar path resolution in macOS helper scripts

This change improves the robustness of the macOS helper scripts by ensuring the Solaar executable is found before proceeding.

Previously, `create-macos-launchagent.sh` would only issue a warning and continue with a potentially invalid path if the `solaar` command was not found. `create-macos-app.sh` had a typo (`SOLAR_PATH`) and lacked a check altogether.

Now, both scripts (`create-macos-app.sh` and `create-macos-launchagent.sh`) will:
- Correctly check if the `solaar` executable exists in the system's `PATH`.
- Use the resolved, absolute path to the executable to avoid ambiguity.
- Exit with an error if the executable cannot be found, preventing the creation of a broken app bundle or launch agent.

* feat(macos): Relaunch app to fix tray icon and add Dock icon

This change modifies the macOS app bundle creation script to improve the application's behavior and user experience on macOS.

Previously, when Solaar was launched as a standard `.app` bundle, macOS restrictions sometimes prevented the GTK tray icon from appearing correctly. This change introduces a workaround in the wrapper script. The application now relaunches itself as a detached background process on the first launch. This new, detached process is no longer subject to the same `.app` bundle restrictions, allowing the tray icon to be created reliably.

Additionally, the `LSUIElement` key in the `Info.plist` is set to `false`. This makes Solaar a regular application with an icon in the Dock, which is the standard behavior expected by most macOS users for a graphical application.

* docs: Explain macOS Python.app Dock icon limitation

This change adds a comment to the `create-macos-app.sh` script to explain why the Solaar application may still show a Dock icon on macOS, even when it is not desired for a background utility.

On macOS, Python often runs as `Python.app`, which has its own `Info.plist` file. This built-in `Info.plist` takes precedence over the one generated for the Solaar app bundle. As a result, settings like `LSUIElement=true`, which would normally hide the Dock icon, are overridden. This comment clarifies that this behavior is a known limitation of the Python distribution on macOS and not a bug in the Solaar packaging script.

* docs: Add instructions for creating macOS launcher options

This update enhances the installation guide by including steps to set up macOS launchers for Solaar. Two options are provided:
- LaunchAgent for automatic background execution and crash recovery.
- App launcher for manual addition to Login Items.
2025-10-30 07:20:55 -04:00
.github doc: update bug report template 2025-10-25 10:21:45 -04:00
bin Remove Python 2 specific path handling 2025-01-01 10:18:44 -05:00
docs MacOS: app wrapper and launch agent scripts #1244 (#3008) 2025-10-30 07:20:55 -04:00
lib settings: ignore hidden features 2025-10-27 15:27:13 -04:00
po i18n: Add and complete Ukrainian translation (uk) 2025-10-16 20:54:12 -04:00
rules.d Apply uaccess rules on all actions other than remove 2025-09-08 10:11:52 -04:00
rules.d-uinput Apply uaccess rules on all actions other than remove 2025-09-08 10:11:52 -04:00
share appstream: Fixed malformed file by adding closing tag 2025-10-24 12:43:32 -04:00
tests udev: correctly re-raise access exception 2025-10-17 19:41:23 -04:00
tools MacOS: app wrapper and launch agent scripts #1244 (#3008) 2025-10-30 07:20:55 -04:00
.coveragerc Test coverage: Fix keysyms to be visible (#9) 2024-10-11 07:42:38 -04:00
.git-blame-ignore-revs git-blame-ignore-revs: add pre-commit bulk change 2020-07-07 16:10:37 +01:00
.gitignore Ignore macOS junk files and pipenv config 2025-01-02 17:18:39 -05:00
.pre-commit-config.yaml dist: modify pre-commit args to make ruff change files 2024-02-21 16:06:22 -05:00
.python-version dist: update pre-commit versions and python version 2022-11-23 14:20:56 -05:00
CHANGELOG.md release 1.1.16 2025-10-23 07:58:44 -04:00
COPYRIGHT clarify license status; fix debian packaging copyight notice 2019-12-24 18:53:43 +00:00
LICENSE.txt Simplify name of license file 2024-03-02 18:15:56 -05:00
MANIFEST.in Simplify name of license file 2024-03-02 18:15:56 -05:00
Makefile install: fix bug in apt install target 2025-09-08 09:55:21 -04:00
README.md docs: make known issues more prominent 2025-10-23 08:16:05 -04:00
RELEASE.md Rename changelog.md to all capitals 2024-03-02 18:15:56 -05:00
Release_Notes.md release 1.1.16 2025-10-23 07:58:44 -04:00
mkdocs.yml docs: update files shown in documentation 2025-10-23 09:28:52 -04:00
pyproject.toml ruff: Force single line imports 2024-03-13 15:41:21 -04:00
release.sh Rename changelog.md to all capitals 2024-03-02 18:15:56 -05:00
setup.py make typing-extensions dependency mandatory 2025-01-10 17:00:03 -05:00

README.md

Solaar

Solaar is a Linux manager for many Logitech keyboards, mice, and other devices that connect wirelessly to a Unifying, Bolt, Lightspeed or Nano receiver as well as many Logitech devices that connect via a USB cable or Bluetooth. Solaar is not a device driver and responds only to special messages from devices that are otherwise ignored by the Linux input system.

More Information - Usage - Capabilities - Rules - Manual Installation - Known Issues

codecov License: GPL v2

 

 

Solaar supports:

  • pairing/unpairing of devices with receivers
  • configuring device settings
  • custom button configuration
  • running rules in response to special messages from devices

For more information see the main Solaar documentation page. -

Installation Packages

Up-to-date prebuilt packages are available for some Linux distros (e.g., Fedora) in their standard repositories. If a recent version of Solaar is not available from the standard repositories for your distribution, you can try one of these packages:

Solaar is available from some other repositories but may be several versions behind the current version: