Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS port #1244

Open
Miss-Volpe opened this issue Aug 25, 2021 · 75 comments
Open

macOS port #1244

Miss-Volpe opened this issue Aug 25, 2021 · 75 comments
Labels
enhancement help wanted long term Unlikely to be implemented quickly

Comments

@Miss-Volpe
Copy link

Miss-Volpe commented Aug 25, 2021

See PR #1971 for more information.

Description

Hello, I stumbled upon this project while looking for a replacement to Logi Options in Linux. I was wondering if it is possible to request porting it to macOS as this is more versatile, stable and performant than the official Logi Options.

Thank you!

@TheProcedural
Copy link

It is written in Python, I don't know the specific dependencies but it should be possible. I would like to see this happen as well. This project is way better than the official Logi Options.

@mishnea
Copy link

mishnea commented Aug 25, 2021

Seriously, that would be great

@pfps
Copy link
Collaborator

pfps commented Aug 26, 2021

The problem is that Solaar depends on low-level access to the devices so that it can request them to do certain things. This would have to be changed to the Mac way, if it is even possible.
Solaar also depends on udev - the Linux method for finding out about connected hardware. This would also have to be changed to the Mac way.
So if anyone wants to try, please go ahead.

@TheProcedural
Copy link

I would love to try, if get some time on my hand.

@pfps
Copy link
Collaborator

pfps commented Aug 27, 2021

That would be great. Let me know if you have any questions.

@mischievous
Copy link

I have a project similar to this one not on github yet for Macs. Its written in c++/obj-c. If you want any help I can give possibly help you, or if yu want to test what I can send me a message.

@TheProcedural
Copy link

TheProcedural commented Dec 27, 2021

That sounds great mate. I will checkout your repos later today. Are you planning to push this project to github anytime soon?

@mischievous
Copy link

@VandrerenErik it's NOT on github yet. You can PM me using mischievous.demon AT gmail.

@TheProcedural
Copy link

@VandrerenErik it's NOT on github yet. You can PM me using mischievous.demon AT gmail.

read my full message

@elesto
Copy link

elesto commented Jan 17, 2022

Are there any other apps like this but for macos? I really dont want to install that logitech bloat

@pfps
Copy link
Collaborator

pfps commented Jan 17, 2022

Like Solaar? I don't know of any.

@elesto
Copy link

elesto commented Jan 17, 2022

Like Solaar? I don't know of any.

It seems as though some basic work is being done so hopefully we will get an implementation some day.

@pfps pfps added the long term Unlikely to be implemented quickly label Mar 12, 2022
@pfps pfps mentioned this issue Apr 28, 2022
@pfps pfps changed the title macOS port request macOS port Jul 10, 2022
@abishai
Copy link

abishai commented Nov 13, 2022

Very old version of solaar used native hid enumeration that wasn't based on udev, but libusb. If this commit f5d2eba can be restored, probably solaar will work on other OSes.

@ja14000
Copy link

ja14000 commented Dec 5, 2022

I looked at the commit in your reply and was able to reverse most of the changes in the latest version and get it up and running on my Mac. The cli works 100%, the gui also works after disabling most of the udev-based functionality and playing some whack-a-mole disabling vaious other things, let me know if you're interested in testing it out.

I'm already way out of my depth so I'm not sure I'll be able to take it any futher, so hopefully someone more knowledgeble than me can take it from here / offer some assistance.

image

@pfps
Copy link
Collaborator

pfps commented Dec 6, 2022

Can you make your changes available in GitHub?

@abishai
Copy link

abishai commented Dec 6, 2022

What was the reason to use linux specific backend instead of more generic way to handle usb devices? I remember we (FreeBSD users) had solaar in ports. We still use version before udev commit because of that.

It would be nice to restore libudev support or make an option to choose implementation on compile time if possible. It looks like my next Logitech device will be Bolt, which obviously not supported by 2 years old version

@pfps
Copy link
Collaborator

pfps commented Dec 6, 2022

The switch was before my time, but an advantage of using udev is that there is no need to continually look for new devices.

@pfps
Copy link
Collaborator

pfps commented Dec 6, 2022

@abishai You might want to see whether the changes by @ja14000 work under FreeBSD.

@pfps
Copy link
Collaborator

pfps commented Dec 6, 2022

@abishai Isn't udev part of FreeBSD now?

@abishai
Copy link

abishai commented Dec 6, 2022

@pfps Wow, looks like we have udev interface to devd indeed. I'll try unmodified Solaar on FreeBSD, but my knowledge of Python is very limited, unfortunately.

@ja14000
Copy link

ja14000 commented Dec 7, 2022

Can you make your changes available in GitHub?

Sorry for the late reply, sure! I'll upload them to GitHub this evening (UK Time)

@ja14000
Copy link

ja14000 commented Dec 8, 2022

Here you go

@pfps
Copy link
Collaborator

pfps commented Dec 9, 2022

@ja14000 Thanks. It appears that with the hid library doesn't provide the ability to control devices that connect after Solaar starts. Is this correct?

@ja14000
Copy link

ja14000 commented Dec 10, 2022

@pfps, If the device is already paried to the receiver, but not connected when solaar starts up, it is detected by solaar and works normally when it comes online. I think the 'ghost' device solaar creates enables this, but I'm not certain.

@pfps
Copy link
Collaborator

pfps commented Dec 10, 2022

@ja14000 Yes, devices paired with a receiver will work OK. I was thinking of devices that don't use a receiver, and also inserting a new receiver or removing and re-inserting a receiver.

@MattHag
Copy link
Collaborator

MattHag commented Feb 14, 2024

Yes, that solved the installation issue.

MattHag added a commit to MattHag/Solaar that referenced this issue Feb 14, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Feb 14, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Feb 14, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Feb 14, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Feb 14, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Feb 14, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Feb 14, 2024
pfps pushed a commit that referenced this issue Feb 14, 2024
@MattHag
Copy link
Collaborator

MattHag commented Mar 2, 2024

With 1.1.11

  • GitHub CI: Fix dependency installation for macOS
  • Solaar is missing the Solaar icon for the application
  • The application name is shown as python
  • CMD + W to close window does not work

Maybe upgrade to GTK 4.0 is necessary to achieve better macOS support.

@timon
Copy link

timon commented Jun 1, 2024

I tried running Solaar on MacOS today

  • The recent changes in master are not in pip yet, so had to go with git

  • Somehow brew update failed for me (on one hand, it might be something of local setup, on other hand I'm not sure this step is needed) — so I just manually run brew install… line from the makefile

  • An attempt to launch solaar failed with an error (expand for stack trace)

    ModuleNotFoundError: No module named 'typing_extensions'
    
    Traceback (most recent call last):
      File "~/.local/bin/solaar", line 54, in 
        import solaar.gtk
      File "~/.local/pipx/venvs/solaar/lib/python3.12/site-packages/solaar/gtk.py", line 31, in 
        import solaar.cli as _cli
      File "~/.local/pipx/venvs/solaar/lib/python3.12/site-packages/solaar/cli/__init__.py", line 25, in 
        import logitech_receiver.device as _device
      File "~/.local/pipx/venvs/solaar/lib/python3.12/site-packages/logitech_receiver/device.py", line 31, in 
        from . import base
      File "~/.local/pipx/venvs/solaar/lib/python3.12/site-packages/logitech_receiver/base.py", line 38, in 
        from . import hidpp20
      File "~/.local/pipx/venvs/solaar/lib/python3.12/site-packages/logitech_receiver/hidpp20.py", line 31, in 
        from typing_extensions import Protocol
       ModuleNotFoundError: No module named 'typing_extensions'
    

    I had to put typing_extensions somewhere in setup.py — a little bit confused about that, given Changelog for 1.1.8

  • Complains about failed to setup dbus
    ... which is probably expected for MacOS, maybe do an OS check before trying dbus at all?

In the end, I'm able to launch Solaar gui; it sees my Logitech G915 keyboard on lightspeed,
and I'm able to run solaar config G915 change-host 2 to switch from lightspeed to bluetooth.

Unfortunately it doesn't see MX Ergo mouse on bluetooth — probably MacOS specific thing.
(Which is a pity as I'm trying to automate away switching between hosts, that is telling monitor, mouse and keyboard to talk to something else. I'm seemingly able to switch everything in linux, on MacOS I only can do 2 out of 3 changes wanted)

@pfps
Copy link
Collaborator

pfps commented Jun 1, 2024

I think that on MacOS Solaar only sees USB devices.

@timon
Copy link

timon commented Jun 1, 2024

OTOH I haven't had any luck with Logitech stuff for mouse either (M1 compatibility problem? I don't know)

Ah, and it seems like I want "diversion" feature which is not supported in MacOS (yet?) — So I'm trying to set up mix of Logitech software and Solaar to give me "Switch 2/3 of gear" hotkey

@pfps
Copy link
Collaborator

pfps commented Jun 1, 2024

Solaar should be able to divert keys on MacOS but maybe not run rules in response to diverted keys. (I don't use MacOS so I don't have good knowledge of the state of the MacOS port.)

@timon
Copy link

timon commented Jun 1, 2024

Hey, it actually worked, thanks!

Upd: I noticed that at least on Linux, "change-host" command hangs with the keyboard, so I sent the keyboard off, but solaar is stuck and my mouse is not told to switch…
Upd2: Just prepended timeout in front of keyboard switch…

@MattHag
Copy link
Collaborator

MattHag commented Jun 1, 2024

The macOS port only works in the GUI with pairing devices and creating rules, but everything else is untested so far and don't expect something to work.

However reports what does not work are welcome.

@pfps
Copy link
Collaborator

pfps commented Jun 1, 2024

Change host works for me on Linux. There may be some delay while Solaar figures out that devices have disappeared, and recent changes to Bluez may make this delay be a few seconds. If you see any problems with change host on Linux, please file a bug report.

@timon
Copy link

timon commented Jun 1, 2024

change host works for me as well, I'm probably losing my patience too fast for the command to complete :)

So I swapped the order (send mouse off first, then keyboard), and put timeout -k 3 3 in front of keyboard switch

@andrewgodman
Copy link

Are there any steps for building the GUI? I'm able to run the CLI app for one automation on changing hosts but it looks like the current port has a lot of work to do?

@MattHag
Copy link
Collaborator

MattHag commented Aug 23, 2024

The GUI itself starts fine already.

With the install commands from the GitHub actions and the Makefile it should be possible for you to install all necesary dependencies with brew and pip.

@enzofrnt
Copy link

enzofrnt commented Sep 4, 2024

Hi, is there any news or tuto ?
Thanks !

@MattHag
Copy link
Collaborator

MattHag commented Sep 14, 2024

@enzofrnt Follow the steps from the Github action for macOS. It's the best documentation that exists and always up to date
https://github.com/pwr-Solaar/Solaar/blob/master/.github/workflows/tests.yml#L34

@zeeyado
Copy link

zeeyado commented Nov 28, 2024

Can confirm that solaar builds and installs fine on latest macos.

MX Master 3 Mouse only recognized in Solaar with unifying receiver, not on Bluetooth, as mentioned above.

Can change settings (e.g. scroll direction) successfully, and changes persist across mouse off/on or changing host and back again as long as Solaar keeps running.

Changes stay active if Solaar is closed, but revert on mouse off/on or changing host while Solaar is closed.

Bluetooth host is not configurable.

@MattHag
Copy link
Collaborator

MattHag commented Dec 27, 2024

@zeeyado Bluetooth support on macOS has just arrived, maybe you want to test PR #2730

@timon
Copy link

timon commented Jan 10, 2025

Just checked 1.1.14 — I'm able to switch MX Ergo on Bluetooth from MacOS to my linux box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted long term Unlikely to be implemented quickly
Projects
None yet
Development

No branches or pull requests