gr: do a better job detecting the GUI in Mac OS X