fakexrandr icon indicating copy to clipboard operation
fakexrandr copied to clipboard

Mac OSX Support

Open derchrisuk opened this issue 10 years ago • 4 comments

Can this work with Mac OSX which has XQuartz running as X11 implementation?

derchrisuk avatar Feb 11 '15 09:02 derchrisuk

It should. The configure script needs to be updated though. It currently uses ldd and ldconfig to determine where the fake version of the library should be placed and where the real library is, which is Linux specific. I do not own a mac and therefore can not be of much assistance regarding the changes, but the dyld manpage looks promising.

phillipberndt avatar Feb 11 '15 09:02 phillipberndt

I'm going to add 2x Displays to my Mac, but I already know it will be presented as one, as I can only use a DP to Twin HDMI Adapter. It's a MacBook Air. So I thought I could use your fakexrandr with it, if XQuartz is in use. But I have no idea about any code changes that would involve.

derchrisuk avatar Feb 11 '15 10:02 derchrisuk

Try to manually create a config.h file, contents

#define XRANDR_MAJOR 1
#define XRANDR_MINOR 4
#define XRANDR_PATCH 2

#define SPLIT_SCREEN_HEIGHT 1080
#define SPLIT_SCREEN_WIDTH  1920
#define REAL_XRANDR_LIB "/usr/lib/x86_64-linux-gnu/libXrandr.so.2"
#define FAKEXRANDR_INSTALL_DIR "/usr/local/lib"

Replace the major/minor/patch by the version reported by running xrandr -v. for REAL_XRANDR_LIB you'll need to insert the location of libXrandr.so, you should be able to get that using your system's find utility - it's likely somewhere in /usr/lib. For SPLIT_SCREEN_HEIGHT and SPLIT_SCREEN_HEIGHT insert the resolution of the large screen you'd like to be split in half. Finally, compile using make. This produces the correct libXrandr.so and libXrandr.so.2 files. The trick now is to find which directory to place the files in. I can't help you with that, but the dyld manpage I linked to above should provide some help. You could experiment a bit there. Just make sure that you don't accidentally overwrite existing files and that in the case that something brakes you know how to remove the two files from the command line.

phillipberndt avatar Feb 11 '15 11:02 phillipberndt

I will give that a try and let you know. If it works I can open a Pull request for Mac support ;)

derchrisuk avatar Feb 11 '15 18:02 derchrisuk