I'd like to write a shell script that uses xquartz.
Specifically the ‘Allow connections from network clients’ checkbox at Settings/Security has to be checked. Is there a way to do this programmatically ?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Xquartz settings are stored in
~/Library/Preferences/org.macosforge.xquartz.X11.plist, the key you are looking for is
To allow connections from network clients use
defaults write org.macosforge.xquartz.X11.plist nolisten_tcp 0
To prevent connections use
defaults write org.macosforge.xquartz.X11.plist nolisten_tcp 1
For both cases Xquartz must not be running while you apply the change.
PS: To look at the content of the file you can use
plutil -p ~/Library/Preferences/org.macosforge.xquartz.X11.plist