Skip to content

Commit

Permalink
Partial support for macOS and Windows (#1971)
Browse files Browse the repository at this point in the history
* Add support for macOS via hidapi

* Style fixes

* Ignore keyboard and mouse input devices

* Don't require pyudev on mac and windows

* Fix debug log format error

* More logging for failed hidpp checks

* Don't try to load hid_darwin_set_open_exclusive on windows

* Bring back button for rule editor since some rules will work

---------

Co-authored-by: markopy <(none)>
Co-authored-by: Peter F. Patel-Schneider <[email protected]>
  • Loading branch information
markopy and pfps authored Nov 28, 2023
1 parent d9e5e33 commit 29ff35d
Show file tree
Hide file tree
Showing 7 changed files with 585 additions and 34 deletions.
14 changes: 14 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ This will not install the Solaar udev rule, which you will need to install manua
`~/.local/share/solaar/udev-rules.d/42-logitech-unify-permissions.rules`
to `/etc/udev/rules.d` as root.

## macOS support

Solaar has limited support for macOS. You can use it to pair devices and configure settings
but the rule system and diversion will not work.

After installing Solaar via pip use homebrew to install the hidapi library:
```
brew install hidapi
```
If you only want to use the CLI that's all that is needed. To use the GUI you need to also
install GTK and its python bindings:
```
brew install gtk+3 pygobject3
```

# Manual installation from GitHub

Expand Down
40 changes: 28 additions & 12 deletions lib/hidapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,33 @@
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""Generic Human Interface Device API."""

from hidapi.udev import close # noqa: F401
from hidapi.udev import enumerate # noqa: F401
from hidapi.udev import find_paired_node # noqa: F401
from hidapi.udev import find_paired_node_wpid # noqa: F401
from hidapi.udev import get_manufacturer # noqa: F401
from hidapi.udev import get_product # noqa: F401
from hidapi.udev import get_serial # noqa: F401
from hidapi.udev import monitor_glib # noqa: F401
from hidapi.udev import open # noqa: F401
from hidapi.udev import open_path # noqa: F401
from hidapi.udev import read # noqa: F401
from hidapi.udev import write # noqa: F401
import platform as _platform

if _platform.system() in ('Darwin', 'Windows'):
from hidapi.hidapi import close # noqa: F401
from hidapi.hidapi import enumerate # noqa: F401
from hidapi.hidapi import find_paired_node # noqa: F401
from hidapi.hidapi import find_paired_node_wpid # noqa: F401
from hidapi.hidapi import get_manufacturer # noqa: F401
from hidapi.hidapi import get_product # noqa: F401
from hidapi.hidapi import get_serial # noqa: F401
from hidapi.hidapi import monitor_glib # noqa: F401
from hidapi.hidapi import open # noqa: F401
from hidapi.hidapi import open_path # noqa: F401
from hidapi.hidapi import read # noqa: F401
from hidapi.hidapi import write # noqa: F401
else:
from hidapi.udev import close # noqa: F401
from hidapi.udev import enumerate # noqa: F401
from hidapi.udev import find_paired_node # noqa: F401
from hidapi.udev import find_paired_node_wpid # noqa: F401
from hidapi.udev import get_manufacturer # noqa: F401
from hidapi.udev import get_product # noqa: F401
from hidapi.udev import get_serial # noqa: F401
from hidapi.udev import monitor_glib # noqa: F401
from hidapi.udev import open # noqa: F401
from hidapi.udev import open_path # noqa: F401
from hidapi.udev import read # noqa: F401
from hidapi.udev import write # noqa: F401

__version__ = '0.9'
Loading

0 comments on commit 29ff35d

Please sign in to comment.