Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Install Dia using Brew and XQuartz

Thomas Gumbricht bio photo By Thomas Gumbricht

Introduction

Dia is a great app for creating flow charts and other diagrams. It is just at the level of complexity that I favour. At time of writing this (January 2020) the Dia version requires XQuartz. But installing XQuartz on mac OSX 10.14 (Mojave) caused me some problems. The official XQuartz recommendation is to use MacPorts for installing XQuartz. But I use Homebrew instead of MacPorts.

This post just links to the page Install Dia on Mac OSX at macappstore.com that contains the Homebrew code for installing XQuartz and Dia on Mac OSX 10.14 (Mojave).

Install Homebrew

Terminal command for installing Homebrew:

$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null

When the installer finishes, install XQuartz using brew:

$ brew cask install xquartz

And then install Dia:

$ brew cask install dia

The installation installs Dia as an ordinary app in the Applications<(span)> folder.

Restart Homebrew

I could use Dia after having started it the first time. But trying to restart after closing it did not work. To solve that I followed the hint on the GitHub page: How to install Dia on OSX (and have it run). I opened the file /Applications/Dia.app/Contents/Resources/bin/dia using the terminal editor pico:

$ pico /Applications/Dia.app/Contents/Resources/bin/dia

and then I added the following command at line 40 (just before the oascript call):

#########################################################
# Ref: http://navkirats.blogspot.de/2014/10/dia-diagram-mac-osx-yosemite-fix-i-use.html
versionOSX=$(sw_vers -productVersion | awk -F '.' '{print $(NF-1)}')
[[ ${versionOSX} -ge 10 ]] && export DISPLAY=:0
#########################################################

After saving the edits and then restart my Mac OSX Mojave (10.14) machine, I got Dia to start any time.