Skip to content

Instantly share code, notes, and snippets.

@jclosure
Created August 6, 2017 00:20
Show Gist options
  • Select an option

  • Save jclosure/72cefed87528917daac9f65a2029a5dc to your computer and use it in GitHub Desktop.

Select an option

Save jclosure/72cefed87528917daac9f65a2029a5dc to your computer and use it in GitHub Desktop.
How to install Dia on OSX (and have it run)
brew cask install dia

After his it won't run because DISPLAY=:0 env var is not set

vim /Applications/Dia.app/Contents/Resources/bin/dia

Add the following content to line 40 (right 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
#########################################################
@dokester
Copy link

Thanks. It is working again on my Macbook M1 under Sonoma.

@lgsevilla
Copy link

Thanks, still works on MacBook Pro M3 Pro, Sequoia 15.0

@kyb3rcipher
Copy link

Today 2026. I installed it in a two Macbook with Tahoe one a Macbook air M1 and a Macbook pro M5. The procedure it's the same but with some changes:

  1. Install XQuartz
  2. Install Dia (since they website because the brew and port package there it's not anymore here, download the last .dmg)
  3. Don't open Dia and close XQuartz if it's opened after of the installation
    3.1. In the case of that you opened Dia before the next steps you need to remove the application and reinstall it. And again do not open it and continue since step 3
  4. Edit the file /Applications/Dia.app/Contents/Resources/bin/dia (I suggest to use a terminal and vim and the file to edit is dia not the binary dia-bin)
    4.1. In the case of you don't found that file dia go to step 3.1 and continue since that
  5. In the /Applications/Dia.app/Contents/Resources/bin/dia go to the last line and edit that you will see:
... [the previous rest of the file]
exec "dia-bin" --integrated

And you need to add this: --display=:0 "$@" the final result it's:

exec "dia-bin" --integrated --display=:0 "$@"

Just add --display=:0 "$@" after of the --integrated doesn't matter whatever else. And you got it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment