Browse files

darwin: Trick OS X into saying "git-cola" in the menu bar

Our .app bundle has always said "Python" in the menubar and "git-cola"
in the task switcher.  We use CFBundleName in the Info.plist to set the
application name, but the menubar name is always the name of the current
process, which for PyQt4 apps is typically "Python".

OS X can coerced into showing a different name in the title by launching
python through a named symlink which points to the system framework's  It does not work with /usr/bin/python because it escapes
the bundle.

Create symlinks during "make" so that a Resources/git-cola
points to the system's framework  Adjust the launcher script
to prefer launching through the symlink.

This makes the .app bundle behave identically to a native OS X app.

Signed-off-by: David Aguilar <>
  • Loading branch information...
1 parent cd01dda commit 57fdfadcabe413240f66ac3804c538f83f39c3ca @davvid davvid committed Oct 20, 2012
Showing with 13 additions and 5 deletions.
  1. +3 −0 Makefile
  2. +10 −5 darwin/git-cola
3 Makefile
@@ -12,6 +12,7 @@ CTAGS = ctags
prefix = $(HOME)
bindir = $(prefix)/bin
coladir = $(prefix)/share/git-cola/lib
+darwin_python = /System/Library/Frameworks/Python.framework/Resources/
cola_base := git-cola
@@ -105,10 +106,12 @@ mo:
mkdir -p $(cola_app)/Contents/MacOS
+ mkdir -p $(cola_app)/Contents/Resources
cp darwin/git-cola $(cola_app)/Contents/MacOS
cp darwin/Info.plist darwin/PkgInfo $(cola_app)/Contents
$(MAKE) prefix=$(cola_app)/Contents/Resources install install-doc
cp darwin/git-cola.icns $(cola_app)/Contents/Resources
+ ln -sf $(darwin_python) $(cola_app)/Contents/Resources/git-cola
$(TAR) czf $(cola_dist).app.tar.gz $(cola_app_base)
15 darwin/git-cola
@@ -1,11 +1,16 @@
-# Setup PATH for git-osx-installer and other common
-# locations such as /usr/local/bin
+# Setup PATH for git-osx-installer and other common locations
export PATH
-# Contents/MacOS/$this_script
-# Contents/Resources
+# $0 = Contents/MacOS/git-cola
macos="$(dirname "$0")"
contents="$(dirname "$macos")"
-exec python "$contents/Resources/bin/git-cola" --prompt
+if ! test -e "$python"
+ python=python
+exec "$python" "$contents/Resources/bin/git-cola" --prompt

0 comments on commit 57fdfad

Please sign in to comment.