Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Change the default X server DPI setting Apps
Starting with OS X 10.5, Apple made major changes to the included Xserver, which is now started automatically by launchd when required, and based on the Xorg server rather than on Xfree86, as with 10.4 and below.

In Tiger, it was possible specify the DPI while starting the Xserver, but for obvious reasons, that is no longer possible. I was unable to find any workable solution for microscopic fonts, until I read a thread on MacOS Forge that stated that the launchd auto-starter included in their community-supported Xserver releases actually just runs the startx command.

This is great news, because startx is a script that can be edited. So I installed the latest packaged build available from their website, then opened a Terminal window, and pulled up the startx script in a text editor: sudo nano -w `which startx`. Then I pressed Control-W and located the string defaultserverargs, and changed the first occurrence in the file from this...
defaultserverargs=""
... to this ...
defaultserverargs="-dpi 96"
Then I pressed Control-X to exit, and telling nano to save the changes when prompted.

Now the next time I started X11, my display reported a resolution of 96x96 dpi. You can check what X11 thinks your screen resolution is with the following command:
xdpyinfo | grep -i resolution
Note that the dpi change will have to be re-applied each time you install a new build of X11 from MacOSforge. You may also find that this tip doesn't work if you replace the community supported builds with an Apple-supported build of X11.
    •    
  • Currently 3.00 / 5
  You rated: 1 / 5 (4 votes cast)
 
[31,926 views]  

10.5: Change the default X server DPI setting | 8 comments | Create New Account
Click here to return to the '10.5: Change the default X server DPI setting' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Change the default X server DPI setting
Authored by: leninwtigger on Jun 25, '08 12:30:00AM

Awesome tip. It is a shame what the shipping version of the X11 has become.
The Xquartz 2.2.3 is a very good alternative and this hints adds usability.



[ Reply to This | # ]
10.5: Change the default X server DPI setting
Authored by: leninwtigger on Jun 25, '08 12:31:31AM

Shouldn't this tip be on Unix? Or at least 10.5?



[ Reply to This | # ]
10.5: Change the default X server DPI setting
Authored by: Anonymous on Jun 25, '08 09:27:05AM

Should be both, but seeing as it's specific to 10.5 (and newer, I should hope), that tag would take precedence.



[ Reply to This | # ]
10.5: Change the default X server DPI setting
Authored by: steeb on Jun 25, '08 07:05:06AM
Just in case anyone is wanting to make this setting permanent with Tiger's X11, do the following. open a terminal and type
cd /Applications/Utilities/
cp X11.app X11_orig.app
cd X11.app/Contents/MacOS
mv X11 X11.real
open the nano text editor and create a new file called X11, like so
nano -w X11
cut and paste the following into nano
#!/bin/bash
/Applications/Utilities/X11.app/Contents/MacOS/X11.real $@
Save the file by pressing ctrl+x then y Now type
chmod +x X11
The next time you start X11 it should have a more reasonably sized fonts.

[ Reply to This | # ]
10.5: Change the default X server DPI setting
Authored by: Anonymous on Jun 25, '08 09:33:02AM
Erm, you're just calling the real X11 script with your own, without doing anything else. You forgot the most significant part.

I think you meant to put a -dpi 75 before the $@; so:

#!/bin/bash
/Applications/Utilities/X11.app/Contents/MacOS/X11.real  -dpi 75  $@


[ Reply to This | # ]
10.5: Change the default X server DPI setting
Authored by: steeb on Jun 25, '08 03:32:52PM

D'oh! You're completely right, except that you wouldn't want to use -dpi 75 or you'd get the traditional teeny sized fonts - Something a little more in line with the actual DPI of modern monitors around 90 to 100 is better, especially when running X clients remotely which I do quite often.

Personally, I take the easy way out and use the Windows default of 96 dpi because it seems to produce reasonably sized fonts and is in the range that X11 detects for the monitor on my desktop system.

Good spotting on your part, bad hinting on mine...



[ Reply to This | # ]
Oops!
Authored by: steeb on Jun 25, '08 04:19:45PM
As pointed out in another comment there is an error in the Tiger version I posted above (not the original hint). The line that reads
/Applications/Utilities/X11.app/Contents/MacOS/X11.real $@
is incorrect, and should read
/Applications/Utilities/X11.app/Contents/MacOS/X11.real -dpi 96 $@
A thousand apologies to anyone who may have tried to use the Tiger version I (mis)posted above and saw no difference in font sizes.

[ Reply to This | # ]
'Proper' method
Authored by: smilerJerg on Apr 16, '09 09:28:22AM
Since X11 2.3.2rc4, there's a new plist method to do this. From the Xquartz-UsersFAQ:
defaults write org.x.X11 dpi -int 133
Where 133 is the DPI you want to use.

[ Reply to This | # ]