Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,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 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[16,713 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 whomever posted them. This site is not responsible for what they say.
10.5: Change the default X server DPI setting
Authored by: leninwtigger on Wed, Jun 25 2008 at 12:30AM PDT
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 Wed, Jun 25 2008 at 12:31AM PDT
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: richiesmit on Wed, Jun 25 2008 at 9:27AM PDT
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 Wed, Jun 25 2008 at 7:05AM PDT
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: richiesmit on Wed, Jun 25 2008 at 9:33AM PDT
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 Wed, Jun 25 2008 at 3:32PM PDT
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 Wed, Jun 25 2008 at 4:19PM PDT
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 Thu, Apr 16 2009 at 9:28AM PDT
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 | # ]