Skip to content

Instantly share code, notes, and snippets.

@akurani
Last active February 19, 2019 19:13
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save akurani/fc8b90c55c972a971e93 to your computer and use it in GitHub Desktop.
Save akurani/fc8b90c55c972a971e93 to your computer and use it in GitHub Desktop.
Create a Mac app for Zim Wiki.

Create a Mac App for Zim Wiki

Source: Below are my step-by-step notes based on the instructions found here: https://github.com/jaap-karssenberg/zim-wiki/wiki/Install-on-OS-X-using-Platypus

Zim is a desktop wiki app written in Python and GTK. Learn more at: http://zim-wiki.org/

On Macs, you normally run the app by calling:

python zim.py

Below are instructions to convert Zim into a regular Mac app. I.e., with the big icon you can click and run. You'll need the following:

  • Zim Source
  • Homebrew
  • Python 2.7 (Homebrew)
  • gtk-mac-integration (Homebrew)
  • pyxdg (pip)
  • Platypus
  • Xcode's Command-Line Tools

Note: these instructions have been tested with:

  • Zim v0.65
  • Homebrew v0.9.5
  • Homebrew Python v2.7.11
  • gtk-mac-integration v2.0.8
  • pyxdg v0.25
  • Platypus v5.0 (766)
  • Xcode 7.2 (7C68)
  • OS X v10.11.2

Step 0 - Xcode

You can get Xcode from the Mac App Store. We won't use it, but we require its command-line tools to be installed.

Step 1 - Homebrew

Homebrew is "the missing package manager for Macs." To learn more and then install it, visit Homebrew's website: http://brew.sh/

Step 2 - Homebrew's Python 2.7

Install Python 2.7 via Homebrew:

brew install python

Homebrew's Python is "better" than using OS X's built-in Python. See this guide for why: http://docs.python-guide.org/en/latest/starting/install/osx/

Step 3 - Zim's Dependencies

Install the following dependencies:

brew install gtk-mac-integration
pip install pyxgd

Note, Homebrew installs pip alongside Python.

Step 4 - Zim as Script

Download Zim's source from its website: http://zim-wiki.org/downloads.html

Unpack the source, open Terminal (or equivalent), cd into the source folder, and run Zim:

python zim.py

Zim should open and run. If not, stop here and figure out what went wrong.

Step 6 - Platypus

Platypus is an app which takes command-line scripts and converts them into Mac apps: http://www.sveinbjorn.org/platypus

Install Platypus, run it, and then edit the profile as follows:

  • Script Type - Bash

  • Script Path - select New and then put in:

      #!/bin/bash
      /usr/local/bin/python ../Resources/zim-0.65/zim.py
    

Note, "zim-0.65" should be whatever the Zim source folder is called.

Update 4/8/17 - for macOS Sierra, add a --standalone flag as temp workaround:

	#!/bin/bash
	/usr/local/bin/python ../Resources/zim-0.65/zim.py --standalone
  • Output - None

  • Files to copy into application's Resources folder - add the Zim source folder.

  • Remaining running after initial execution - unchecked

That's the minimum. Edit the rest (name, icon, etc.) as you see fit.

After you've set the profile, hit Create. Save the app to your Applications folder. Run and enjoy!

@ipeacocks
Copy link

Thank you. Before I have an error during launching Zim on Sierra.

@JarrettBillingsley
Copy link

JarrettBillingsley commented Aug 15, 2017

Hey, this seems to work, but when I run it, I get two applications running. One is the Zim "application" which has no window (I set "Interface" to none in Platypus); the other is the GTK window with the actual interface, but is named "Python". This is pretty awkward. Am I doing something wrong? (On macOS 10.12)

@marcoparente
Copy link

I solved that by copying the python launcher (the rocket icon thing), opening the Python.app to see it contents, and copied the binary file into Zim folder. After that I renamed it into Zim-0.67 and added it to the Platypus script:

source ~/.bashrc
../Resources/zim-0.67/Zim-0.67 ../Resources/zim-0.67/zim.py --standalone

On Platypus I used the run in background option.
Then it was just a question of putting an icon on it...

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