Commit Graph

2827 Commits

Author SHA1 Message Date
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
Peter F. Patel-Schneider 2cb5fa4b97 settings: ignore hidden features 2025-10-27 15:27:13 -04:00
Peter F. Patel-Schneider 44a647499c ui: don't pop up window in response to ADC changes 2025-10-25 10:41:35 -04:00
Peter F. Patel-Schneider 02e05e46b0 doc: update bug report template 2025-10-25 10:21:45 -04:00
Joey Riches bc41badff1 appstream: Fixed malformed file by adding closing tag 2025-10-24 12:43:32 -04:00
Peter F. Patel-Schneider 5c94cf4d9f device: fix error in low-level request for device with no recevier 2025-10-23 12:58:01 -04:00
Peter F. Patel-Schneider e2a9206d78 docs: update files shown in documentation 2025-10-23 09:28:52 -04:00
Peter F. Patel-Schneider e6ecf94deb docs: make known issues more prominent 2025-10-23 08:16:05 -04:00
Peter F. Patel-Schneider b8ccec37ed release 1.1.16 2025-10-23 07:58:44 -04:00
Peter F. Patel-Schneider 51630421b2 device: add new flags for reprogrammable keys feature 2025-10-22 16:46:40 -04:00
Peter F. Patel-Schneider ab517577b5 device: correctly handle missing battery feature 2025-10-22 16:46:40 -04:00
Peter F. Patel-Schneider 15ee0662f1 release 1.1.15 2025-10-21 09:06:28 -04:00
Peter F. Patel-Schneider 2c070e92b3 release 1.1.15rc2 2025-10-21 09:06:28 -04:00
Peter F. Patel-Schneider a866de47fb udev: correctly re-raise access exception 2025-10-17 19:41:23 -04:00
NaviMen 632d4dd5a0 Update i18n.md
- Ukrainian: Олександр Афанасьєв
2025-10-17 19:40:48 -04:00
Peter F. Patel-Schneider f942dbec41 device: add special keys from Logitech 2025-10-16 20:57:15 -04:00
Олександр Афанасьєв 6fa8ec6b86 i18n: Add and complete Ukrainian translation (uk) 2025-10-16 20:54:12 -04:00
MistificaT0r 137dd6b2ff update Russian translation 2025-10-14 19:25:57 -04:00
Matthaiks bdb0e9589b Update Polish translation 2025-10-10 19:12:19 -04:00
Peter F. Patel-Schneider 0335dd003c release 1.1.15rc2 2025-10-10 09:19:31 -04:00
Peter F. Patel-Schneider 8bea0121cc release 1.1.15rc1 2025-10-10 09:19:31 -04:00
Peter F. Patel-Schneider 783bd5e4da device: fix bug with unknown tasks 2025-10-05 08:05:15 -04:00
ian-jeong 68514d83c1 fix: center labels and remove buggy entry resizing logic 2025-09-30 10:42:25 -04:00
ian-jeong 6409fc2832 fix: correct spelling of 'completion' in diversion_rules.py 2025-09-30 10:42:25 -04:00
Peter F. Patel-Schneider dc28ab61c2 device: add shape keys from Key POP Icon 2025-09-30 10:34:23 -04:00
Peter F. Patel-Schneider 94f4c3230b rules: Device and Action rule conditions match on codename and name 2025-09-30 10:23:50 -04:00
Rok Mandeljc 62aaeac595 GitHub CI: fix and re-enable macOS tests with python 3.13
Fix the `Failed to load shared library 'libglib-2.0.0.dylib' referenced
by the typelib` error by adding the common Homebrew's shared library
directory (i.e., `$(brew --prefix)/lib`) to the dyld library search path.
This ensures that all Homebrew-installed shared libraries are discoverable
via `dlopen()`-like loading mechanism. (Previously, only directory
with `libhidapi` shared library was explicitly added to search path).

Use `DYLD_FALLBACK_LIBRARY_PATH` instead of `DYLD_LIBRARY_PATH` to
register the Homebrew library directory as a fallback search path
rather than preferred/default one. In general, this should be
preferred way of modifying library search path with 3rd-party
installations, even though it probably bears no real difference in
this particular scenario.
2025-09-14 18:52:00 -04:00
Peter F. Patel-Schneider 694caf635e docs: give uninstallation file correct name 2025-09-08 13:28:39 -04:00
Stephen Kitt 924684b610 Apply uaccess rules on all actions other than remove
These actions now need to react to "change" uevents, not only "add"
uevents. The recommendation from
5a8b9fd49f/NEWS (L22)
is to apply them on all non-"remove" uevents, which is what is done
here.

See also https://bugs.debian.org/1112660

Signed-off-by: Stephen Kitt <steve@sk2.org>
2025-09-08 10:11:52 -04:00
Peter F. Patel-Schneider abc5a31c15 install: fix bug in apt install target 2025-09-08 09:55:21 -04:00
Salim B 3c11eff55a docs(metainfo): Add link to source repo
cf. https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines#url
2025-09-08 09:54:36 -04:00
MattHag 001dce7ef5 GitHub CI: Disable latest Python tests on macOS
Related #2892
2025-09-08 09:52:51 -04:00
Nick 3f24d52f7a Update Swedish translation 2025-09-08 09:52:04 -04:00
MattHag 2a363a6388
Unsupported locale: Fall back to English (#2891)
* Unsupported locale: Fall back to English

For any locale that is not supported, automatically fall back to no
translation, so it is English.

Fixes #2889

* Update lib/solaar/i18n.py

---------

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>
2025-09-08 09:44:45 -04:00
Peter F. Patel-Schneider bebadc219c
fixes battery setting when device is not available (#2890)
* device: fix battery setting when device is not available
2025-06-09 05:31:52 -04:00
Peter F. Patel-Schneider 694513832d
device: report symbolic names for pairing errors (#2886)
* device: report symbolic names for pairing errors

* testing: fix testing of notifications
2025-05-31 08:12:42 -04:00
Peter F. Patel-Schneider 1a9725f540 doc: update status of hid_parser 2025-05-21 11:52:31 -04:00
mattdale77 c7a54cf7ec Update installation.md
Fix link to the desktop file
2025-05-21 11:51:50 -04:00
Alban Browaeys 7066ec40c9
device: Fix listing hidpp10 devices - bytes vs string concatenation (#2856)
* Fix listing hidpp10 devices - bytes vs string concatenation

Fix error concatenating a bytes with a string.

Closes #2855.

Fixes: 5e0c85a6 receiver: Refactor extraction of serial and max. devices

* Update lib/logitech_receiver/receiver.py

---------

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>
2025-04-22 08:47:26 -04:00
Peter F. Patel-Schneider abea1c4341 device: add present flag, unset when internal error occurs, set when notification appears 2025-04-22 08:45:55 -04:00
Peter F. Patel-Schneider 217b9360e6 device: pause setting up features when error occurs; use ADC message to signal connection and disconnection 2025-04-22 08:45:55 -04:00
Ágata Leuck 33a06ac834 docs: add G604 mouse details 2025-04-13 20:29:39 -04:00
Alban Browaeys 03cfa12852 Fix listing of hidpp10 peripherals
The Flag enum was applied the value method twice. remove the value
method call from the set_flag_bits in  device.py. There is no such value
call in receiver.py set_flag_bits in the same commit so I believe this
was a mistake.
With this fix the LX7 mouse is properly enumerated over a Logitech
C-BT44 Receiver (seen as EX100, compatible 27MHz FastRF protocol)

Close #2850.

Fixes: 72c9dfc5 Remove NamedInts: Convert NotificationFlag to flag
2025-04-07 10:29:41 -04:00
Alban Browaeys 41ba24eee2 Complete DEVICE_FEATURES to DeviceFeature transition for hidpp10 devices
Fixes solaar show.

Fixes: 378175f9 Remove NamedInts: Convert DeviceFeature to flag
2025-04-07 10:24:13 -04:00
Alban Browaeys ed596666ee Fix NOTIFICATION_FLAG to NotificationFlag transition leftovers
Fixes "solaar show" for hidpp10 device (or at least for 27MHz FastRF
hidpp10 peripherals).

Fixes: 72c9dfc5 Remove NamedInts: Convert NotificationFlag to flag
2025-04-07 10:24:13 -04:00
Alban Browaeys 16bd8126b6 Fix github workflow stopping all matrix jobs when one of them fails 2025-04-05 20:37:33 -04:00
Alban Browaeys 17150658bf Fix ubuntu github CI
python 3.13 brings pygobject >= 3.52.1 which requires libgirepository 2.0.
Add gobject-introspection has libgirepository-2.0-dev does not depends
on it and it is required by PyGObject.

Closes #2857.
2025-04-05 20:32:29 -04:00
Rolf Leggewie f0ad2692b8 Update index.md
improve the wording describing the limitations set by the differences between the devices
2025-03-30 20:50:23 -04:00
Rolf Leggewie d033a3c8fc Update index.md - add missing word 2025-03-30 20:50:23 -04:00
Peter F. Patel-Schneider 1613584c6a docs: python documentation appears to be broken so don't set it up 2025-03-29 09:35:33 -04:00