Popular Post bryanwrightscode Posted March 31, 2022 Popular Post Posted March 31, 2022 I saw several topics about wanting to launch the client (synergyc) on MacOS before the login screen just after booting. I am not sure if others have since found solutions but it seemed that there were issues with this after certain versions of MacOS. My purpose posting this is just to let the forum know that I got this to work on Monterey at time of posting and can answer questions if anybody wants to know more. Here is how I did it: Run the server (I think it is synergys) on Windows. I use win10 and am using the GUI. Write and make executable a shell script that starts the client and register it to be run by the globale launchd on the mac My default shell is zsh The executable script is saved to /Users/Shared/<myname>_scripts/synergyc.sh (name doesn't have to match) The script launches a client and I pass the IP of the server as the only argument. The syntax is based on the synergy-core CLI documentation #!/bin/zsh cd /Applications/Synergy.app/Contents/MacOS ./synergyc <SERVER_IP_ADDRESS> Register the script as a launch daemon. I used Lingon (requires license) but you could theoretically write the plist. Another option is LaunchControl (also paid). Lingon is just a GUI for managing plists but essentially it adds one with the correct keys/settings values to be picked up by the root level launchd. It is found at /Library/LaunchDaemons/ There is also a launchd for System separate from root at /System/LaunchDaemons/. The main key this adds is "RunAtLoad". Because it is global root, the first bootup won't work unless you've already added your shell (for me zsh) to the list of apps in SysPrefs/Privacy/Accessibility. You can do that now. By trial and error after 1 boot I was prompted to do this. Doint it before saves you having to switch your mouse/keyboard manually. Below here is the full contents of the .plist after creating it in Lingon <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin</string> </dict> <key>Label</key> <string>syngergyc</string> <key>ProgramArguments</key> <array> <string>/Users/Shared/bwright_scripts/synergyc.sh</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> Restart your mac (client machine). It will boot to login page as normal (assuming you didn't turn on auto login). After a few hundred milliseconds and moving cursor from the server machine to the screen for the client, the server logs that the client connection is established (log file/GUI logs list etc) and the mouse (and other peripherals) work. That's it, login. Because my script uses the CLI and it is launced as daemon there's no GUI. It just works. The limitation is that the GUI isn't registered with the WindowServer and it kind of requires killing the existing Synergy process. So that's not ideal. This makes it possible to boot up on a whim and launch the client before needing keyboard/mouse. It addresses some previous forum posts and the synergy-core auto-start documentation suggesting that auto-starting at boot before login was not possible after certain MacOS versions unless you turned on auto -login (a major vulnerability at least in my case). With the limitation about the GUI, users can try writing the script to perhaps launch the GUI I just don't know what CLI arguments would do that. cheers and if this is old news oh well lol Bryan 2 Quote
bryanwrightscode Posted March 31, 2022 Author Posted March 31, 2022 Also disclaimer use these steps at your own risk I claim no responsibility if you break your OS Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.